Skip to content

Commit be0ac01

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of #44158 - dtolnay:zero48, r=sfackler
Use a byte literal ASCII 0 instead of its decimal value @SimonSapin noticed this in dtolnay/itoa#8.
2 parents a88757e + 4312ed7 commit be0ac01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/fmt/num.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ macro_rules! impl_Display {
242242
// decode last 1 or 2 chars
243243
if n < 10 {
244244
curr -= 1;
245-
*buf_ptr.offset(curr) = (n as u8) + 48;
245+
*buf_ptr.offset(curr) = (n as u8) + b'0';
246246
} else {
247247
let d1 = n << 1;
248248
curr -= 2;

0 commit comments

Comments
 (0)