From 771981288e4a9f762051f86936905b83a2c0f911 Mon Sep 17 00:00:00 2001 From: Arthur Carcano Date: Tue, 7 Mar 2023 14:14:36 +0100 Subject: [PATCH] Make iana-time-zone a target specific dependency Currently, iana-tiime-zone is only used on cfg(unix). This crate, and its windows code in particular, contains a lot of unsafe, so it seems prudent to limit its scope to where it is actually needed. --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1a5c0d9d2b..14ae4d0322 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ serde = { version = "1.0.99", default-features = false, optional = true } pure-rust-locales = { version = "0.5.2", optional = true } criterion = { version = "0.4.0", optional = true } rkyv = {version = "0.7", optional = true} -iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"] } arbitrary = { version = "1.0.0", features = ["derive"], optional = true } [target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies] @@ -47,6 +46,9 @@ js-sys = { version = "0.3", optional = true } # contains FFI bindings for the JS [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.0", features = ["std", "minwinbase", "minwindef", "timezoneapi"], optional = true } +[target.'cfg(unix)'.dependencies] +iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"] } + [dev-dependencies] serde_json = { version = "1" } serde_derive = { version = "1", default-features = false }