File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1067,13 +1067,23 @@ impl fmt::Debug for Duration {
1067
1067
}
1068
1068
1069
1069
if self . secs > 0 {
1070
- fmt_decimal ( f, self . secs , self . nanos , 100_000_000 ) ?;
1070
+ fmt_decimal ( f, self . secs , self . nanos , NANOS_PER_SEC / 10 ) ?;
1071
1071
f. write_str ( "s" )
1072
- } else if self . nanos >= 1_000_000 {
1073
- fmt_decimal ( f, self . nanos as u64 / 1_000_000 , self . nanos % 1_000_000 , 100_000 ) ?;
1072
+ } else if self . nanos >= NANOS_PER_MILLI {
1073
+ fmt_decimal (
1074
+ f,
1075
+ ( self . nanos / NANOS_PER_MILLI ) as u64 ,
1076
+ self . nanos % NANOS_PER_MILLI ,
1077
+ NANOS_PER_MILLI / 10 ,
1078
+ ) ?;
1074
1079
f. write_str ( "ms" )
1075
- } else if self . nanos >= 1_000 {
1076
- fmt_decimal ( f, self . nanos as u64 / 1_000 , self . nanos % 1_000 , 100 ) ?;
1080
+ } else if self . nanos >= NANOS_PER_MICRO {
1081
+ fmt_decimal (
1082
+ f,
1083
+ ( self . nanos / NANOS_PER_MICRO ) as u64 ,
1084
+ self . nanos % NANOS_PER_MICRO ,
1085
+ NANOS_PER_MICRO / 10 ,
1086
+ ) ?;
1077
1087
f. write_str ( "µs" )
1078
1088
} else {
1079
1089
fmt_decimal ( f, self . nanos as u64 , 0 , 1 ) ?;
You can’t perform that action at this time.
0 commit comments