Skip to content
Myr

chore(deps): Replace `humantime` with `jiff`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Shun Sakai · committed by Shun Sakai · parent a4fdad6 · Browse files · 5 files+57 added−17 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+57 added−17 removed

  • tests:+5 added−1 removed
  • other:+52 added−16 removed

5 files+57 added−17 removed

modified:src/filter/time.rs+4 added-2 removed
1use chrono::{DateTime, Local, NaiveDate, NaiveDateTime};2use jiff::Span;33use std::time::SystemTime;4use std::time::{Duration, SystemTime};56/// Filter based on time ranges.7#[derive(Debug, PartialEq, Eq)]8pub enum TimeFilter {
2 unmodified lines
11}1213impl TimeFilter {14 fn from_str(ref_time: &SystemTime, s: &str) -> Option<SystemTime> {14 humantime::parse_duration(s)15 s.parse::<Span>()16 .and_then(Duration::try_from)17 .map(|duration| *ref_time - duration)18 .ok()19 .or_else(|| {20 DateTime::parse_from_rfc3339(s)
146 unmodified lines
modified:tests/tests.rs+5 added-1 removed
6 unmodified lines
7use std::path::Path;8use std::time::{Duration, SystemTime};9use test_case::test_case;1011use jiff::Timestamp;12use normpath::PathExt;13use regex::escape;1415use crate::testenv::TestEnv;
2272 unmodified lines
2288}22892290#[cfg(test)]2291fn change_file_modified<P: AsRef<Path>>(path: P, iso_date: &str) {2291 let st = humantime::parse_rfc3339(iso_date).expect("invalid date");2292 let st = iso_date2293 .parse::<Timestamp>()2294 .map(SystemTime::from)2295 .expect("invalid date");2296 let ft = filetime::FileTime::from_system_time(st);2297 filetime::set_file_times(path, ft, ft).expect("time modification failde");2298}2299
395 unmodified lines
modified:Cargo.lock+46 added-13 removed
324 unmodified lines
325 "etcetera",326 "faccess",327 "filetime",328 "globset",329 "humantime",329 "ignore",330 "jemallocator",331 "jiff",332 "libc",333 "lscolors",334 "nix 0.29.0",335 "normpath",
57 unmodified lines
393 "windows-sys 0.52.0",394]395396[[package]]397name = "humantime"398version = "2.1.0"399source = "registry+https://github.com/rust-lang/crates.io-index"400checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"401402[[package]]397name = "iana-time-zone"398version = "0.1.60"399source = "registry+https://github.com/rust-lang/crates.io-index"400checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
57 unmodified lines
458 "libc",459]460461[[package]]462name = "jiff"463version = "0.2.4"464source = "registry+https://github.com/rust-lang/crates.io-index"465checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e"466dependencies = [467 "jiff-static",468 "log",469 "portable-atomic",470 "portable-atomic-util",471 "serde",472]473474[[package]]475name = "jiff-static"476version = "0.2.4"477source = "registry+https://github.com/rust-lang/crates.io-index"478checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9"479dependencies = [480 "proc-macro2",481 "quote",482 "syn",483]484485[[package]]486name = "js-sys"487version = "0.3.70"488source = "registry+https://github.com/rust-lang/crates.io-index"489checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
108 unmodified lines
598source = "registry+https://github.com/rust-lang/crates.io-index"599checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"600601[[package]]602name = "portable-atomic"603version = "1.11.0"604source = "registry+https://github.com/rust-lang/crates.io-index"605checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"606607[[package]]608name = "portable-atomic-util"609version = "0.2.4"610source = "registry+https://github.com/rust-lang/crates.io-index"611checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"612dependencies = [613 "portable-atomic",614]615616[[package]]617name = "proc-macro2"585version = "1.0.86"618version = "1.0.94"619source = "registry+https://github.com/rust-lang/crates.io-index"587checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"620checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"621dependencies = [622 "unicode-ident",623]624625[[package]]626name = "quote"594version = "1.0.36"627version = "1.0.40"628source = "registry+https://github.com/rust-lang/crates.io-index"596checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"629checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"630dependencies = [631 "proc-macro2",632]633
90 unmodified lines
724checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"725726[[package]]727name = "syn"695version = "2.0.75"728version = "2.0.100"729source = "registry+https://github.com/rust-lang/crates.io-index"697checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9"730checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"731dependencies = [732 "proc-macro2",733 "quote",734 "unicode-ident",
281 unmodified lines
modified:Cargo.toml+1 added-1 removed
modified:CHANGELOG.md+1 added
8 unmodified lines
91011## Changes1213- Replace `humantime` crate with `jiff` crate, see #1690 (@sorairolake)1415## Other1617
788 unmodified lines