Skip to content

Commit 7b667fc

Browse files
committedMar 21, 2024
Set minimum version of chrono to 0.4.31
Newer versions of chrono have deprecated various functions, leading to compiler warnings. This diff migrates to the non-deprecated interface, which requires bumping the minimum version of `chrono` since that interface does't exist in older versions.
1 parent db0ea44 commit 7b667fc

File tree

4 files changed

+58
-21
lines changed

4 files changed

+58
-21
lines changed
 

‎Cargo-1.65.lock

+52-14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ version = "1.0.2"
1717
source = "registry+https://github.com/rust-lang/crates.io-index"
1818
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
1919

20+
[[package]]
21+
name = "android-tzdata"
22+
version = "0.1.1"
23+
source = "registry+https://github.com/rust-lang/crates.io-index"
24+
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
25+
26+
[[package]]
27+
name = "android_system_properties"
28+
version = "0.1.5"
29+
source = "registry+https://github.com/rust-lang/crates.io-index"
30+
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
31+
dependencies = [
32+
"libc",
33+
]
34+
2035
[[package]]
2136
name = "anyhow"
2237
version = "1.0.80"
@@ -269,17 +284,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
269284

270285
[[package]]
271286
name = "chrono"
272-
version = "0.4.19"
287+
version = "0.4.35"
273288
source = "registry+https://github.com/rust-lang/crates.io-index"
274-
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
289+
checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a"
275290
dependencies = [
291+
"android-tzdata",
292+
"iana-time-zone",
276293
"js-sys",
277-
"libc",
278-
"num-integer",
279294
"num-traits",
280295
"serde",
281296
"wasm-bindgen",
282-
"winapi",
297+
"windows-targets 0.52.4",
283298
]
284299

285300
[[package]]
@@ -757,6 +772,29 @@ dependencies = [
757772
"tokio-native-tls",
758773
]
759774

775+
[[package]]
776+
name = "iana-time-zone"
777+
version = "0.1.60"
778+
source = "registry+https://github.com/rust-lang/crates.io-index"
779+
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
780+
dependencies = [
781+
"android_system_properties",
782+
"core-foundation-sys",
783+
"iana-time-zone-haiku",
784+
"js-sys",
785+
"wasm-bindgen",
786+
"windows-core",
787+
]
788+
789+
[[package]]
790+
name = "iana-time-zone-haiku"
791+
version = "0.1.2"
792+
source = "registry+https://github.com/rust-lang/crates.io-index"
793+
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
794+
dependencies = [
795+
"cc",
796+
]
797+
760798
[[package]]
761799
name = "idna"
762800
version = "0.5.0"
@@ -932,15 +970,6 @@ dependencies = [
932970
"tempfile",
933971
]
934972

935-
[[package]]
936-
name = "num-integer"
937-
version = "0.1.46"
938-
source = "registry+https://github.com/rust-lang/crates.io-index"
939-
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
940-
dependencies = [
941-
"num-traits",
942-
]
943-
944973
[[package]]
945974
name = "num-traits"
946975
version = "0.2.18"
@@ -1935,6 +1964,15 @@ version = "0.4.0"
19351964
source = "registry+https://github.com/rust-lang/crates.io-index"
19361965
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
19371966

1967+
[[package]]
1968+
name = "windows-core"
1969+
version = "0.52.0"
1970+
source = "registry+https://github.com/rust-lang/crates.io-index"
1971+
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
1972+
dependencies = [
1973+
"windows-targets 0.52.4",
1974+
]
1975+
19381976
[[package]]
19391977
name = "windows-sys"
19401978
version = "0.48.0"

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ serde_json = "1.0"
5858
sha2 = "0.10"
5959
ureq = { version = "2", optional = true }
6060
url = { version = "2.1", features = ["serde"] }
61-
chrono = { version = "0.4", default-features = false, features = ["clock", "serde", "std", "wasmbind"] }
61+
chrono = { version = "0.4.31", default-features = false, features = ["clock", "serde", "std", "wasmbind"] }
6262
serde_path_to_error = "0.1.2"
6363

6464
[target.'cfg(target_arch = "wasm32")'.dependencies]

‎src/devicecode.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,7 @@ mod tests {
889889
}
890890
fn next(&mut self) -> DateTime<Utc> {
891891
let next_value = self.times.next().unwrap();
892-
let naive = chrono::NaiveDateTime::from_timestamp(next_value, 0);
893-
DateTime::<Utc>::from_utc(naive, chrono::Utc)
892+
DateTime::from_timestamp(next_value, 0).unwrap()
894893
}
895894
}
896895

‎src/introspection.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ mod tests {
457457
use crate::tests::{mock_http_client, new_client};
458458
use crate::{AccessToken, AuthType, ClientId, IntrospectionUrl, RedirectUrl, Scope};
459459

460-
use chrono::{TimeZone, Utc};
460+
use chrono::DateTime;
461461
use http::header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE};
462462
use http::{HeaderValue, Response, StatusCode};
463463

@@ -577,15 +577,15 @@ mod tests {
577577
introspection_response.token_type
578578
);
579579
assert_eq!(
580-
Some(Utc.timestamp(1604073517, 0)),
580+
Some(DateTime::from_timestamp(1604073517, 0).unwrap()),
581581
introspection_response.exp
582582
);
583583
assert_eq!(
584-
Some(Utc.timestamp(1604073217, 0)),
584+
Some(DateTime::from_timestamp(1604073217, 0).unwrap()),
585585
introspection_response.iat
586586
);
587587
assert_eq!(
588-
Some(Utc.timestamp(1604073317, 0)),
588+
Some(DateTime::from_timestamp(1604073317, 0).unwrap()),
589589
introspection_response.nbf
590590
);
591591
assert_eq!(Some("demo".to_string()), introspection_response.sub);

0 commit comments

Comments
 (0)
Please sign in to comment.