Update 'time' to 0.2 in 'contrib'.

This commit is contained in:
Sergio Benitez 2020-03-25 14:39:55 -07:00
parent ff4b63c0be
commit 06e146e7d1
6 changed files with 15 additions and 15 deletions

View File

@ -79,7 +79,7 @@ memcache = { version = "0.14", optional = true }
r2d2-memcache = { version = "0.5", optional = true } r2d2-memcache = { version = "0.5", optional = true }
# SpaceHelmet dependencies # SpaceHelmet dependencies
time = { version = "0.1.40", optional = true } time = { version = "0.2.9", optional = true }
# Compression dependencies # Compression dependencies
brotli = { version = "3.3", optional = true } brotli = { version = "3.3", optional = true }

View File

@ -212,12 +212,12 @@ impl Default for ExpectCt {
impl Into<Header<'static>> for &ExpectCt { impl Into<Header<'static>> for &ExpectCt {
fn into(self) -> Header<'static> { fn into(self) -> Header<'static> {
let policy_string = match self { let policy_string = match self {
ExpectCt::Enforce(age) => format!("max-age={}, enforce", age.num_seconds()), ExpectCt::Enforce(age) => format!("max-age={}, enforce", age.whole_seconds()),
ExpectCt::Report(age, uri) => { ExpectCt::Report(age, uri) => {
format!(r#"max-age={}, report-uri="{}""#, age.num_seconds(), uri) format!(r#"max-age={}, report-uri="{}""#, age.whole_seconds(), uri)
} }
ExpectCt::ReportAndEnforce(age, uri) => { ExpectCt::ReportAndEnforce(age, uri) => {
format!("max-age={}, enforce, report-uri=\"{}\"", age.num_seconds(), uri) format!("max-age={}, enforce, report-uri=\"{}\"", age.whole_seconds(), uri)
} }
}; };
@ -298,11 +298,11 @@ impl Default for Hsts {
impl Into<Header<'static>> for &Hsts { impl Into<Header<'static>> for &Hsts {
fn into(self) -> Header<'static> { fn into(self) -> Header<'static> {
let policy_string = match self { let policy_string = match self {
Hsts::Enable(age) => format!("max-age={}", age.num_seconds()), Hsts::Enable(age) => format!("max-age={}", age.whole_seconds()),
Hsts::IncludeSubDomains(age) => { Hsts::IncludeSubDomains(age) => {
format!("max-age={}; includeSubDomains", age.num_seconds()) format!("max-age={}; includeSubDomains", age.whole_seconds())
} }
Hsts::Preload(age) => format!("max-age={}; preload", age.num_seconds()), Hsts::Preload(age) => format!("max-age={}; preload", age.whole_seconds()),
}; };
Header::new(Hsts::NAME, policy_string) Header::new(Hsts::NAME, policy_string)

View File

@ -95,13 +95,13 @@ mod helmet_tests {
assert_header!( assert_header!(
response, response,
"Strict-Transport-Security", "Strict-Transport-Security",
format!("max-age={}", Duration::weeks(52).num_seconds()) format!("max-age={}", Duration::weeks(52).whole_seconds())
); );
assert_header!( assert_header!(
response, response,
"Expect-CT", "Expect-CT",
format!("max-age={}, enforce", Duration::days(30).num_seconds()) format!("max-age={}, enforce", Duration::days(30).whole_seconds())
); );
assert_header!(response, "Referrer-Policy", "no-referrer"); assert_header!(response, "Referrer-Policy", "no-referrer");

View File

@ -111,9 +111,9 @@ error[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri
81 | uri!(other_q: rest = _, id = 100); 81 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation | ---------------------------------- in this macro invocation
| |
::: $ROCKET/core/http/src/uri/uri_display.rs:467:40 ::: $ROCKET/core/http/src/uri/uri_display.rs:469:40
| |
467 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { } 469 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable` | ------------ required by this bound in `rocket::http::uri::assert_ignorable`
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
@ -127,9 +127,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http:
83 | uri!(other_q: rest = S, id = _); 83 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation | -------------------------------- in this macro invocation
| |
::: $ROCKET/core/http/src/uri/uri_display.rs:467:40 ::: $ROCKET/core/http/src/uri/uri_display.rs:469:40
| |
467 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { } 469 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable` | ------------ required by this bound in `rocket::http::uri::assert_ignorable`
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -23,7 +23,7 @@ private-cookies = ["cookie/secure"]
smallvec = "1.0" smallvec = "1.0"
percent-encoding = "1" percent-encoding = "1"
hyper = { version = "0.10.13", default-features = false } hyper = { version = "0.10.13", default-features = false }
time = "0.2.4" time = "0.2.9"
indexmap = "1.0" indexmap = "1.0"
rustls = { version = "0.16", optional = true } rustls = { version = "0.16", optional = true }
state = "0.4" state = "0.4"

View File

@ -31,7 +31,7 @@ log = "0.4"
toml = "0.4.7" toml = "0.4.7"
num_cpus = "1.0" num_cpus = "1.0"
state = "0.4.1" state = "0.4.1"
time = "0.2.4" time = "0.2.9"
memchr = "2" # TODO: Use pear instead. memchr = "2" # TODO: Use pear instead.
binascii = "0.1" binascii = "0.1"
pear = "0.1" pear = "0.1"