refactor: replace the deprecated usage of chrono::TimeZone::ymd

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 <orhunparmaksiz@gmail.com>
This commit is contained in:
Orhun Parmaksız authored and Wez Furlong committed 2022-11-20 09:39:10 -08:00
1 parent 173862634e
commit 0bf36e5ada
1 file changed
+1 -1
+1 -1
View File
@@ -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}");
}