Skip to content

Commit

Permalink
fix(deps): replace parse_duration with humantime (#2074)
Browse files Browse the repository at this point in the history
The former is no longer maintained, with a long standing security
advisory (RUSTSEC-2021-0041).
  • Loading branch information
nc7s authored Jun 3, 2024
1 parent 83637d9 commit b0b1d07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 62 deletions.
60 changes: 1 addition & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/atuin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interim = { workspace = true }
config = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
parse_duration = "2.1.1"
humantime = "2.1.0"
async-trait = { workspace = true }
itertools = { workspace = true }
rand = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/atuin-client/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use config::{
};
use eyre::{bail, eyre, Context, Error, Result};
use fs_err::{create_dir_all, File};
use parse_duration::parse;
use humantime::parse_duration;
use regex::RegexSet;
use semver::Version;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -553,7 +553,7 @@ impl Settings {
return Ok(false);
}

match parse(self.sync_frequency.as_str()) {
match parse_duration(self.sync_frequency.as_str()) {
Ok(d) => {
let d = time::Duration::try_from(d).unwrap();
Ok(OffsetDateTime::now_utc() - Settings::last_sync()? >= d)
Expand Down

0 comments on commit b0b1d07

Please sign in to comment.