From 6f9af6fc1a110ca508a9a6a11cbd687f3119078b Mon Sep 17 00:00:00 2001 From: Eric Sheppard Date: Wed, 10 Aug 2022 22:51:43 +1000 Subject: [PATCH] set fallback feature in iana-time-zone depedency --- Cargo.toml | 3 +-- src/offset/local/unix.rs | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b5b9820054..cc6d93c376 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,13 +40,12 @@ serde = { version = "1.0.99", default-features = false, optional = true } pure-rust-locales = { version = "0.5.2", optional = true } criterion = { version = "0.3", optional = true } rkyv = {version = "0.7", optional = true} +iana-time-zone = { version = "0.1.41", optional = true, features = ["fallback"] } [target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies] wasm-bindgen = { version = "0.2" } js-sys = { version = "0.3" } # contains FFI bindings for the JS Date API -[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "solaris", target_env = "sgx")))'.dependencies] -iana-time-zone = { version = "0.1.41", optional = true } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.0", features = ["std", "minwinbase", "minwindef", "timezoneapi"], optional = true } diff --git a/src/offset/local/unix.rs b/src/offset/local/unix.rs index ab91dfde38..46845b69d4 100644 --- a/src/offset/local/unix.rs +++ b/src/offset/local/unix.rs @@ -103,12 +103,6 @@ const TZDB_LOCATION: &str = " /system/usr/share/zoneinfo"; #[cfg(not(target_os = "android"))] const TZDB_LOCATION: &str = "/usr/share/zoneinfo"; -#[cfg(any(target_os = "emscripten", target_os = "wasi", target_os = "solaris"))] -fn fallback_timezone() -> Option { - Some(TimeZone::utc()) -} - -#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "solaris")))] fn fallback_timezone() -> Option { let tz_name = iana_time_zone::get_timezone().ok()?; let bytes = fs::read(format!("{}/{}", TZDB_LOCATION, tz_name)).ok()?;