Skip to content

Commit

Permalink
Use a byte literal ASCII 0 instead of its decimal value
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 29, 2017
1 parent faf477a commit 4312ed7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ macro_rules! impl_Display {
// decode last 1 or 2 chars
if n < 10 {
curr -= 1;
*buf_ptr.offset(curr) = (n as u8) + 48;
*buf_ptr.offset(curr) = (n as u8) + b'0';
} else {
let d1 = n << 1;
curr -= 2;
Expand Down

0 comments on commit 4312ed7

Please sign in to comment.