From 10f8c0e1b4e047a02a748056444205458684cf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Sun, 1 Dec 2024 07:24:16 +0100 Subject: [PATCH] fix: remove unnecessary print in `cargo time` (#66) --- src/template/timings.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/template/timings.rs b/src/template/timings.rs index 194464e..fb79835 100644 --- a/src/template/timings.rs +++ b/src/template/timings.rs @@ -31,17 +31,10 @@ impl Timings { /// Rehydrate timings from a JSON file. If not present, returns empty timings. pub fn read_from_file() -> Self { - let s = fs::read_to_string(TIMINGS_FILE_PATH) + fs::read_to_string(TIMINGS_FILE_PATH) .map_err(|x| x.to_string()) - .and_then(Timings::try_from); - - match s { - Ok(timings) => timings, - Err(e) => { - eprintln!("{e}"); - Timings::default() - } - } + .and_then(Timings::try_from) + .unwrap_or_default() } /// Merge two sets of timings, overwriting `self` with `other` if present.