Use a byte literal ASCII 0 instead of its decimal value

This commit is contained in:
David Tolnay 2017-08-29 10:01:12 -07:00
parent faf477a8c2
commit 4312ed765a
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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;