@@ -261,8 +261,7 @@ impl TimeValLike for TimeSpec {
261
261
fn seconds ( seconds : i64 ) -> TimeSpec {
262
262
assert ! (
263
263
( TS_MIN_SECONDS ..=TS_MAX_SECONDS ) . contains( & seconds) ,
264
- "TimeSpec out of bounds; seconds={}" ,
265
- seconds
264
+ "TimeSpec out of bounds; seconds={seconds}" ,
266
265
) ;
267
266
let mut ts = zero_init_timespec ( ) ;
268
267
ts. tv_sec = seconds as time_t ;
@@ -662,18 +661,18 @@ impl fmt::Display for TimeVal {
662
661
663
662
let sec = abs. tv_sec ( ) ;
664
663
665
- write ! ( f, "{}" , sign ) ?;
664
+ write ! ( f, "{sign}" ) ?;
666
665
667
666
if abs. tv_usec ( ) == 0 {
668
- if abs . tv_sec ( ) == 1 {
669
- write ! ( f, "{} second" , sec ) ?;
667
+ if sec == 1 {
668
+ write ! ( f, "1 second" ) ?;
670
669
} else {
671
- write ! ( f, "{} seconds" , sec ) ?;
670
+ write ! ( f, "{sec } seconds" ) ?;
672
671
}
673
672
} else if abs. tv_usec ( ) % 1000 == 0 {
674
- write ! ( f, "{}.{:03} seconds" , sec , abs. tv_usec( ) / 1000 ) ?;
673
+ write ! ( f, "{sec }.{:03} seconds" , abs. tv_usec( ) / 1000 ) ?;
675
674
} else {
676
- write ! ( f, "{}.{:06} seconds" , sec , abs. tv_usec( ) ) ?;
675
+ write ! ( f, "{sec }.{:06} seconds" , abs. tv_usec( ) ) ?;
677
676
}
678
677
679
678
Ok ( ( ) )
0 commit comments