File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -440,12 +440,8 @@ where
440
440
( secs / 60 , "m " )
441
441
} ;
442
442
443
- let n = format ! ( "{n:>3}" ) ;
444
- format ! (
445
- "{timestamp}{unit} " ,
446
- timestamp = self . styled( Style :: new( ) . dimmed( ) , n) ,
447
- unit = self . styled( Style :: new( ) . dimmed( ) , unit) ,
448
- )
443
+ let timestamp = format ! ( "{n:>3}" ) ;
444
+ self . style_timestamp ( timestamp, unit)
449
445
}
450
446
451
447
fn format_timestamp_with_decimals ( & self , start : std:: time:: Instant ) -> String {
@@ -463,10 +459,14 @@ where
463
459
( secs, "s " )
464
460
} ;
465
461
466
- let n = format ! ( " {n:.2}" ) ;
462
+ let timestamp = format ! ( " {n:.2}" ) ;
463
+ self . style_timestamp ( timestamp, unit)
464
+ }
465
+
466
+ fn style_timestamp ( & self , timestamp : String , unit : & str ) -> String {
467
467
format ! (
468
468
"{timestamp}{unit} " ,
469
- timestamp = self . styled( Style :: new( ) . dimmed( ) , n ) ,
469
+ timestamp = self . styled( Style :: new( ) . dimmed( ) , timestamp ) ,
470
470
unit = self . styled( Style :: new( ) . dimmed( ) , unit) ,
471
471
)
472
472
}
You can’t perform that action at this time.
0 commit comments