From e83158bcbe5f50130ff872ec408934f5759f94a4 Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Mon, 2 Sep 2024 15:14:40 +0200 Subject: [PATCH] Mark `js-sys` as optional for identity_core In #1397 my intention was to make the `js-sys` dependency mutually exclusive with the feature `custom_time`. As it turns out, it's not that simple and mixing target specific dependencies with feature specific dependencies does not actually work. See [here](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies) and [here](https://doc.rust-lang.org/cargo/reference/features.html#mutually-exclusive-features). So this removes the broken feature reference in the dependency declaration and instead marks it as `optional`. Also, the feature `custom_time` takes precedence over `js-sys` so these do not actually conflict and one _could_ enable both. --- identity_core/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/identity_core/Cargo.toml b/identity_core/Cargo.toml index f8aa615b28..adf556d16f 100644 --- a/identity_core/Cargo.toml +++ b/identity_core/Cargo.toml @@ -21,8 +21,8 @@ time = { version = "0.3.23", default-features = false, features = ["std", "serde url = { version = "2.4", default-features = false, features = ["serde"] } zeroize = { version = "1.6", default-features = false } -[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi"), not(feature = "custom_time")))'.dependencies] -js-sys = { version = "0.3.55", default-features = false } +[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] +js-sys = { version = "0.3.55", default-features = false, optional = true } [dev-dependencies] proptest = { version = "1.0.0" }