Skip to content

Commit

Permalink
Rollup merge of rust-lang#44158 - dtolnay:zero48, r=sfackler
Browse files Browse the repository at this point in the history
Use a byte literal ASCII 0 instead of its decimal value

@SimonSapin noticed this in dtolnay/itoa#8.
  • Loading branch information
Ariel Ben-Yehuda authored Aug 29, 2017
2 parents df7d744 + 4312ed7 commit a5e3484
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 a5e3484

Please sign in to comment.