File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ fn format_zero(digits: Option<usize>) -> String {
131131 let mut out = String :: with_capacity ( 2 + count) ;
132132 out. push ( '0' ) ;
133133 out. push ( '.' ) ;
134- out. extend ( std:: iter:: repeat ( '0' ) . take ( count) ) ;
134+ out. extend ( std:: iter:: repeat_n ( '0' , count) ) ;
135135 out
136136 }
137137 }
@@ -269,10 +269,9 @@ fn adjust_decimal_digits(
269269
270270 if round_up {
271271 if digits > 0 {
272- if increment_digits ( & mut frac_digits) {
273- if increment_digits ( & mut int_digits) {
274- int_digits. insert ( 0 , 1 ) ;
275- }
272+ if increment_digits ( & mut frac_digits) && increment_digits ( & mut int_digits)
273+ {
274+ int_digits. insert ( 0 , 1 ) ;
276275 }
277276 } else if increment_digits ( & mut int_digits) {
278277 int_digits. insert ( 0 , 1 ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub(crate) use {
99 std:: {
1010 cell:: RefCell ,
1111 collections:: HashMap ,
12+ f64,
1213 fmt:: { self , Display , Formatter } ,
1314 fs,
1415 ops:: Range ,
You can’t perform that action at this time.
0 commit comments