Skip to content

Commit

Permalink
Do not depend on android-tzdata if the clock feature is not enabled
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
AlexTMjugador committed Aug 21, 2023
1 parent 0be4e7c commit dd51776
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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" }
Expand Down

0 comments on commit dd51776

Please sign in to comment.