Skip to content

Commit

Permalink
Mark js-sys as optional for identity_core
Browse files Browse the repository at this point in the history
In iotaledger#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.
  • Loading branch information
frederikrothenberger committed Sep 2, 2024
1 parent 842f483 commit e83158b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions identity_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit e83158b

Please sign in to comment.