From cea5f840ef0281c8ccf9cc0250b2d07082847038 Mon Sep 17 00:00:00 2001 From: Andrew Aylett Date: Tue, 7 Jan 2025 20:15:53 +0000 Subject: style: Avoid calling `unwrap()` when we don't have to (#2519) Use `if let` rather than `is_some()` followed by `unwrap()`, and coerce errors instead of calling `unwrap()` when available. --- crates/atuin-client/src/settings.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/atuin-client/src') diff --git a/crates/atuin-client/src/settings.rs b/crates/atuin-client/src/settings.rs index 10c804fa..4c2b10ab 100644 --- a/crates/atuin-client/src/settings.rs +++ b/crates/atuin-client/src/settings.rs @@ -613,7 +613,7 @@ impl Settings { match parse_duration(self.sync_frequency.as_str()) { Ok(d) => { - let d = time::Duration::try_from(d).unwrap(); + let d = time::Duration::try_from(d)?; Ok(OffsetDateTime::now_utc() - Settings::last_sync()? >= d) } Err(e) => Err(eyre!("failed to check sync: {}", e)), -- cgit v1.3.1