We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cargo time
1 parent a49a1d3 commit 10f8c0eCopy full SHA for 10f8c0e
src/template/timings.rs
@@ -31,17 +31,10 @@ impl Timings {
31
32
/// Rehydrate timings from a JSON file. If not present, returns empty timings.
33
pub fn read_from_file() -> Self {
34
- let s = fs::read_to_string(TIMINGS_FILE_PATH)
+ fs::read_to_string(TIMINGS_FILE_PATH)
35
.map_err(|x| x.to_string())
36
- .and_then(Timings::try_from);
37
-
38
- match s {
39
- Ok(timings) => timings,
40
- Err(e) => {
41
- eprintln!("{e}");
42
- Timings::default()
43
- }
44
+ .and_then(Timings::try_from)
+ .unwrap_or_default()
45
}
46
47
/// Merge two sets of timings, overwriting `self` with `other` if present.
0 commit comments