Fixes chrono warnings (#49)

This commit is contained in:
Óscar García Amor 2024-11-06 13:40:49 +01:00 committed by GitHub
parent c1862d30ad
commit 2e5d031d1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -17,7 +17,7 @@ clap = { version = "^4.5.6", features = ["string"] }
log = "^0.4.17" log = "^0.4.17"
env_logger = "^0.11.5" env_logger = "^0.11.5"
rusqlite = { version = "0.32", features = ["bundled"] } rusqlite = { version = "0.32", features = ["bundled"] }
chrono = { version = "^0.4.22", features = ["serde"] } chrono = { version = "^0.4.38", features = ["serde"] }
[dev-dependencies] [dev-dependencies]
actix-rt = "2" actix-rt = "2"

View file

@ -89,7 +89,7 @@ mod test {
Snapshot { Snapshot {
version_id, version_id,
versions_since: 3, versions_since: 3,
timestamp: Utc.ymd(2001, 9, 9).and_hms(1, 46, 40), timestamp: Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap(),
}, },
snapshot_data.clone(), snapshot_data.clone(),
) )

View file

@ -921,7 +921,7 @@ mod test {
Snapshot { Snapshot {
version_id: version_ids[2], version_id: version_ids[2],
versions_since: 2, versions_since: 2,
timestamp: Utc.ymd(2001, 9, 9).and_hms(1, 46, 40), timestamp: Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap(),
}, },
vec![1, 2, 3], vec![1, 2, 3],
)?; )?;
@ -997,7 +997,7 @@ mod test {
Snapshot { Snapshot {
version_id: snapshot_version_id, version_id: snapshot_version_id,
versions_since: 3, versions_since: 3,
timestamp: Utc.ymd(2001, 9, 9).and_hms(1, 46, 40), timestamp: Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap(),
}, },
data.clone(), data.clone(),
)?; )?;

View file

@ -150,7 +150,7 @@ impl StorageTxn for Txn {
) { ) {
(Some(ts), Some(vs), Some(v)) => Some(Snapshot { (Some(ts), Some(vs), Some(v)) => Some(Snapshot {
version_id: v.0, version_id: v.0,
timestamp: Utc.timestamp(ts, 0), timestamp: Utc.timestamp_opt(ts, 0).unwrap(),
versions_since: vs, versions_since: vs,
}), }),
_ => None, _ => None,