Rollup merge of #44158 - dtolnay:zero48, r=sfackler

Use a byte literal ASCII 0 instead of its decimal value

@SimonSapin noticed this in https://github.com/dtolnay/itoa/pull/8.
This commit is contained in:
Ariel Ben-Yehuda 2017-08-29 21:41:04 +00:00 committed by GitHub
commit be0ac0124c

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;