diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2022-11-28 16:50:57 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2022-11-28 16:50:59 +0100 |
commit | 5d9cb2727061eeb2c264c6e865cf3e7b96e21d64 (patch) | |
tree | b2996691bd4cd665739c1e0ce03e772f471bb24f | |
parent | 7f0dbef196d72693f3ac69048fca6b6bb1557f91 (diff) |
Fix: Do not use deprecated function
Replace use of deprecated function with Utc.with_ymd_and_hms().
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | tests/datetime.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/datetime.rs b/tests/datetime.rs index e15bdce..b8c64e5 100644 --- a/tests/datetime.rs +++ b/tests/datetime.rs @@ -86,25 +86,25 @@ fn test_datetime() { // JSON let date: DateTime<Utc> = s.get("json_datetime").unwrap(); - assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53)); + assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 10, 2, 14, 53).unwrap()); // TOML let date: DateTime<Utc> = s.get("toml_datetime").unwrap(); - assert_eq!(date, Utc.ymd(2017, 5, 11).and_hms(14, 55, 15)); + assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 11, 14, 55, 15).unwrap()); // YAML let date: DateTime<Utc> = s.get("yaml_datetime").unwrap(); - assert_eq!(date, Utc.ymd(2017, 6, 12).and_hms(10, 58, 30)); + assert_eq!(date, Utc.with_ymd_and_hms(2017, 6, 12, 10, 58, 30).unwrap()); // INI let date: DateTime<Utc> = s.get("ini_datetime").unwrap(); - assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53)); + assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 10, 2, 14, 53).unwrap()); // RON let date: DateTime<Utc> = s.get("ron_datetime").unwrap(); - assert_eq!(date, Utc.ymd(2021, 4, 19).and_hms(11, 33, 2)); + assert_eq!(date, Utc.with_ymd_and_hms(2021, 4, 19, 11, 33, 2).unwrap()); } |