Skip to content

Commit 4312ed7

Browse files
committed
Use a byte literal ASCII 0 instead of its decimal value
1 parent faf477a commit 4312ed7

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)