1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-27 10:39:03 +02:00

Replace deprecated methods with now_utc()

This commit is contained in:
Yuki Okushi
2020-05-09 08:07:31 +09:00
parent 6b5215d439
commit 446b920d96
2 changed files with 4 additions and 4 deletions

View File

@ -360,7 +360,7 @@ impl Inner {
let mut cookie = Cookie::named(self.name.clone());
cookie.set_value("");
cookie.set_max_age(Duration::zero());
cookie.set_expires(OffsetDateTime::now() - Duration::days(365));
cookie.set_expires(OffsetDateTime::now_utc() - Duration::days(365));
let val = HeaderValue::from_str(&cookie.to_string())
.map_err(error::ErrorInternalServerError)?;
@ -638,7 +638,7 @@ mod test {
.find(|c| c.name() == "test-session")
.unwrap();
assert_ne!(
OffsetDateTime::now().year(),
OffsetDateTime::now_utc().year(),
cookie_4.expires().map(|t| t.year()).unwrap()
);