Skip to content

Commit 956613f

Browse files
committed
refactor
1 parent 1026b7c commit 956613f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

git-date/tests/time/parse.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, str::FromStr, time::SystemTime};
1+
use std::{collections::HashMap, time::SystemTime};
22

33
use bstr::{BString, ByteSlice};
44
use git_date::{time::Sign, Time};
@@ -15,14 +15,13 @@ static BASELINE: Lazy<HashMap<BString, (usize, u32)>> = Lazy::new(|| {
1515
let mut lines = baseline.lines();
1616
while let Some(date_str) = lines.next() {
1717
let exit_code = lines.next().expect("three lines per baseline").to_str()?.parse()?;
18-
let output = u32::from_str(
19-
lines
20-
.next()
21-
.expect("three lines per baseline")
22-
.to_str()
23-
.expect("valid utf"),
24-
)
25-
.expect("valid epoch value");
18+
let output: u32 = lines
19+
.next()
20+
.expect("three lines per baseline")
21+
.to_str()
22+
.expect("valid utf")
23+
.parse()
24+
.expect("valid epoch value");
2625
map.insert(date_str.into(), (exit_code, output));
2726
}
2827
Ok(map)

0 commit comments

Comments
 (0)