From dd517765bcb8a8370ae7e74c84d5791068b0c0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Mon, 21 Aug 2023 15:03:32 +0200 Subject: [PATCH] Do not depend on `android-tzdata` if the `clock` feature is not enabled All usages of `android-tzdata` types are within the `offset::local` module, but such module is not built if the `clock` feature is not enabled. Therefore, `android-tzdata` is effectively an unused dependency when the `clock` feature is disabled. To avoid downloading unnecessary crates on build time, let's make the dependency on `android-tzdata` conditional on enabling the `clock` feature, as it was done with e.g. `iana-time-zone`. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2c27250ca7..ac55f10aab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ default = ["clock", "std", "oldtime", "wasmbind"] alloc = [] libc = [] std = [] -clock = ["std", "winapi", "iana-time-zone"] +clock = ["std", "winapi", "iana-time-zone", "android-tzdata"] oldtime = ["time"] wasmbind = ["wasm-bindgen", "js-sys"] unstable-locales = ["pure-rust-locales", "alloc"] @@ -50,7 +50,7 @@ winapi = { version = "0.3.0", features = ["std", "minwinbase", "minwindef", "tim iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"] } [target.'cfg(target_os = "android")'.dependencies] -android-tzdata = "0.1.1" +android-tzdata = { version = "0.1.1", optional = true } [dev-dependencies] serde_json = { version = "1" }