diff options
| author | Andrew Aylett <andrew@aylett.co.uk> | 2025-01-07 20:15:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-07 20:15:53 +0000 |
| commit | cea5f840ef0281c8ccf9cc0250b2d07082847038 (patch) | |
| tree | 312e936a2bf622150702372c49acfeafefa272a4 /crates/atuin-client | |
| parent | chore: Remove unneeded dependencies (#2523) (diff) | |
| download | atuin-cea5f840ef0281c8ccf9cc0250b2d07082847038.zip | |
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.
Diffstat (limited to 'crates/atuin-client')
| -rw-r--r-- | crates/atuin-client/src/settings.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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)), |
