1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-25 02:13:09 +03:00

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 2022-11-20 19:26:46 +03:00 committed by Wez Furlong
parent 173862634e
commit 0bf36e5ada

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}");
}