diff options
Diffstat (limited to 'version-helper')
-rw-r--r-- | version-helper/Cargo.toml | 2 | ||||
-rw-r--r-- | version-helper/src/lib.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/version-helper/Cargo.toml b/version-helper/Cargo.toml index 971eb87e..69b0a1d1 100644 --- a/version-helper/Cargo.toml +++ b/version-helper/Cargo.toml @@ -13,4 +13,4 @@ edition = "2021" rust-version = "1.63" [dependencies] -chrono = { version = "0.4.19", default-features = false, features = ["std", "clock"] } +chrono = { version = "0.4.23", default-features = false, features = ["std", "clock"] } diff --git a/version-helper/src/lib.rs b/version-helper/src/lib.rs index ccd90f63..cc7455d7 100644 --- a/version-helper/src/lib.rs +++ b/version-helper/src/lib.rs @@ -85,10 +85,12 @@ fn cargo_mtime_date(crate_dir: path::PathBuf) -> Option<chrono::DateTime<chrono: let metadata = fs::metadata(&cargo_toml).ok()?; let mtime = metadata.modified().ok()?; let unix_time = mtime.duration_since(SystemTime::UNIX_EPOCH).ok()?; - let dt = chrono::Utc.timestamp(unix_time.as_secs().try_into().ok()?, 0); + let dt = chrono::Utc + .timestamp_opt(unix_time.as_secs().try_into().ok()?, 0) + .latest()?; // FIXME: Work around https://github.com/rust-lang/cargo/issues/10285 - if dt.date().year() < 2015 { + if dt.date_naive().year() < 2015 { return None; } |