From 4312ed765a5f3354f3214fb3b214bff64ae8ccbf Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Aug 2017 10:01:12 -0700 Subject: [PATCH] Use a byte literal ASCII 0 instead of its decimal value --- src/libcore/fmt/num.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 4ca303dee43f2..8ea388fddf884 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -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;