Skip to content

Commit 7a5ab7b

Browse files
committed
Make building with time support on wasm optional
1 parent 635798b commit 7a5ab7b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ serde = { version = "1.0.136", default-features = false, features = ["derive", "
3535
serde_json = { version = "1.0.45", default-features = false, features = ["alloc"], optional = true }
3636
unicode-xid = { version = "0.2.0", default-features = false, optional = true }
3737
rust_decimal = { version = "1.24.0", default-features = false, features = ["maths"], optional = true }
38-
getrandom = { version = "0.2.7", optional = true }
3938
rustyline = { version = "15.0.0", optional = true }
4039
document-features = { version = "0.2.0", optional = true }
4140
arbitrary = { version = "1.3.2", optional = true, features = ["derive"] }
@@ -118,9 +117,9 @@ no_std = ["no-std-compat", "num-traits/libm", "core-error", "libm", "hashbrown",
118117
#! ### JavaScript Interface for WASM
119118

120119
## Use [`wasm-bindgen`](https://crates.io/crates/wasm-bindgen) as JavaScript interface.
121-
wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"]
120+
wasm-bindgen = ["instant/wasm-bindgen"]
122121
## Use [`stdweb`](https://crates.io/crates/stdweb) as JavaScript interface.
123-
stdweb = ["getrandom/js", "instant/stdweb"]
122+
stdweb = ["instant/stdweb"]
124123

125124
#! ### Features used in testing environments only
126125

@@ -156,7 +155,9 @@ codegen-units = 1
156155
#panic = 'abort' # remove stack backtrace for no-std
157156

158157
[target.'cfg(target_family = "wasm")'.dependencies]
159-
instant = { version = "0.1.10" } # WASM implementation of std::time::Instant
158+
instant = { version = "0.1.10", optional = true } # WASM implementation of std::time::Instant
159+
getrandom = { version = "0.2.7", features = ["js"] }
160+
160161

161162
[package.metadata.docs.rs]
162163
features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging"]

0 commit comments

Comments
 (0)