Skip to content

Commit

Permalink
Auto merge of rust-lang#95107 - r00ster91:fmt, r=joshtriplett
Browse files Browse the repository at this point in the history
Improve formatting in macro

CC `@dtolnay`
  • Loading branch information
bors committed Mar 22, 2022
2 parents b9c4067 + 7e3fd59 commit 3ea4493
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ macro_rules! impl_Exp {
}
(fmt_prec.saturating_sub(prec), prec.saturating_sub(fmt_prec))
}
None => (0,0)
None => (0, 0)
};
for _ in 1..subtracted_precision {
n/=10;
n /= 10;
exponent += 1;
}
if subtracted_precision != 0 {
Expand Down Expand Up @@ -392,7 +392,7 @@ macro_rules! impl_Exp {
// SAFETY: In either case, `exp_buf` is written within bounds and `exp_ptr[..len]`
// is contained within `exp_buf` since `len <= 3`.
let exp_slice = unsafe {
*exp_ptr.offset(0) = if upper {b'E'} else {b'e'};
*exp_ptr.offset(0) = if upper { b'E' } else { b'e' };
let len = if exponent < 10 {
*exp_ptr.offset(1) = (exponent as u8) + b'0';
2
Expand Down

0 comments on commit 3ea4493

Please sign in to comment.