Commit 33ed54e 1 parent fbcd538 commit 33ed54e Copy full SHA for 33ed54e
File tree 4 files changed +70
-33
lines changed
4 files changed +70
-33
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,7 @@ rayon = "1.5.1"
55
55
56
56
serde = { version = " 1.0" , features = [" derive" ] }
57
57
shlex = " 1.1.0"
58
- humantime = " 2"
59
- humantime-serde = " 1"
58
+ jiff = { version = " 0.2.4" , default-features = false }
60
59
toml_edit = { version = " 0.22.13" , features = [" serde" ] }
61
60
escargot = { version = " 0.5.13" , optional = true }
62
61
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use std::eprintln;
11
11
#[ cfg( not( feature = "color" ) ) ]
12
12
use std:: io:: stderr;
13
13
14
+ use jiff:: SignedDuration ;
14
15
use rayon:: prelude:: * ;
15
16
use snapbox:: data:: DataFormat ;
16
17
use snapbox:: dir:: FileType ;
@@ -68,10 +69,11 @@ impl Runner {
68
69
status. spawn. status. summary( ) ,
69
70
) ;
70
71
if let Some ( duration) = status. duration {
72
+ let duration = SignedDuration :: try_from ( duration) . unwrap ( ) ;
71
73
let _ = write ! (
72
74
stderr,
73
75
" {}" ,
74
- palette. hint( humantime :: format_duration ( duration) ) ,
76
+ palette. hint( format! ( "{ duration:#}" ) ) ,
75
77
) ;
76
78
}
77
79
let _ = writeln ! ( stderr) ;
@@ -90,10 +92,11 @@ impl Runner {
90
92
palette. error( "failed" ) ,
91
93
) ;
92
94
if let Some ( duration) = status. duration {
95
+ let duration = SignedDuration :: try_from ( duration) . unwrap ( ) ;
93
96
let _ = write ! (
94
97
stderr,
95
98
" {}" ,
96
- palette. hint( humantime :: format_duration ( duration) ) ,
99
+ palette. hint( format! ( "{ duration:#}" ) ) ,
97
100
) ;
98
101
}
99
102
let _ = writeln ! ( stderr) ;
Original file line number Diff line number Diff line change @@ -645,12 +645,27 @@ pub struct OneShot {
645
645
#[ serde( default ) ]
646
646
pub ( crate ) binary : bool ,
647
647
#[ serde( default ) ]
648
- #[ serde( deserialize_with = "humantime_serde::deserialize " ) ]
648
+ #[ serde( deserialize_with = "deserialize_jiff_duration " ) ]
649
649
pub ( crate ) timeout : Option < std:: time:: Duration > ,
650
650
#[ serde( default ) ]
651
651
pub ( crate ) fs : Filesystem ,
652
652
}
653
653
654
+ fn deserialize_jiff_duration < ' de , D > (
655
+ deserializer : D ,
656
+ ) -> Result < Option < std:: time:: Duration > , D :: Error >
657
+ where
658
+ D : serde:: Deserializer < ' de > ,
659
+ {
660
+ use serde:: de:: Deserialize ;
661
+
662
+ let buf = String :: deserialize ( deserializer) ?;
663
+
664
+ buf. parse :: < jiff:: SignedDuration > ( )
665
+ . map ( |e| Some ( e. unsigned_abs ( ) ) )
666
+ . map_err ( serde:: de:: Error :: custom)
667
+ }
668
+
654
669
impl OneShot {
655
670
fn parse_toml ( s : & str ) -> Result < Self , crate :: Error > {
656
671
toml_edit:: de:: from_str ( s) . map_err ( |e| e. to_string ( ) . into ( ) )
You can’t perform that action at this time.
0 commit comments