Skip to content

Commit 794b054

Browse files
komi1230SergioBenitez
authored andcommitted
Replace deprecated 'OffsetDateTime::now' with 'OffsetDateTime::now_utc'.
Update 'time' dependency accordingly.
1 parent b8f9011 commit 794b054

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

core/http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private-cookies = ["cookie/secure"]
2323
smallvec = "1.0"
2424
percent-encoding = "1"
2525
hyper = { version = "0.10.13", default-features = false }
26-
time = "0.2.9"
26+
time = "0.2.11"
2727
indexmap = "1.0"
2828
rustls = { version = "0.16", optional = true }
2929
state = "0.4"

core/http/src/cookies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl Cookies<'_> {
373373
}
374374

375375
if cookie.expires().is_none() {
376-
cookie.set_expires(time::OffsetDateTime::now() + time::Duration::weeks(1));
376+
cookie.set_expires(time::OffsetDateTime::now_utc() + time::Duration::weeks(1));
377377
}
378378

379379
if cookie.same_site().is_none() {

core/lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ log = "0.4"
3131
toml = "0.4.7"
3232
num_cpus = "1.0"
3333
state = "0.4.1"
34-
time = "0.2.9"
34+
time = "0.2.11"
3535
memchr = "2" # TODO: Use pear instead.
3636
binascii = "0.1"
3737
pear = "0.1"

core/lib/src/local/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl<'c> LocalRequest<'c> {
414414
// with the changes reflected by `response`.
415415
if let Some(ref jar) = client.cookies {
416416
let mut jar = jar.write().expect("LocalRequest::_dispatch() write lock");
417-
let current_time = time::OffsetDateTime::now();
417+
let current_time = time::OffsetDateTime::now_utc();
418418
for cookie in response.cookies() {
419419
if let Some(expires) = cookie.expires() {
420420
if expires <= current_time {

0 commit comments

Comments
 (0)