From 0bf36e5adab16a3ed4a67ee346790963396b99ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sun, 20 Nov 2022 19:26:46 +0300 Subject: [PATCH] refactor: replace the deprecated usage of `chrono::TimeZone::ymd` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since `chrono` 0.4.23, `chrono::TimeZone::ymd` is deprecated in favor of `with_ymd_and_hms()`. This commit removes the deprecated usage and switches to the new `chrono` library API. Signed-off-by: Orhun Parmaksız --- frecency/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frecency/src/lib.rs b/frecency/src/lib.rs index 295a81287..1e5e70e63 100644 --- a/frecency/src/lib.rs +++ b/frecency/src/lib.rs @@ -127,7 +127,7 @@ mod tests { #[test] fn serialize() { use chrono::TimeZone; - let now = Utc.ymd(2022, 08, 31).and_hms(22, 16, 0); + let now = Utc.with_ymd_and_hms(2022, 08, 31, 22, 16, 0).unwrap(); let f = Frecency::new_at_time(now); assert_eq!(serde_json::to_string(&f).unwrap(), "{\"half_life\":259200,\"last_accessed\":1661984160,\"frecency\":0.0,\"num_accesses\":0}"); } -- 2.51.2