Skip to content

Commit be52341

Browse files
committed
Enable wasm32-unknown-unknown support for getrandom if needed
See for details https://docs.rs/getrandom/0.2.16/getrandom/index.html#webassembly-support. We only enable it if compiling for WASM, following getrandom's advice to not enable it unconditionally for our users. Note that with getrandom 0.3 the feature flag name changes to wasm_js, and an extra RUSTFLAG is required.
1 parent f35c3e8 commit be52341

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ sha2 = { version = "0.10.7", optional = true, features = ["oid"] }
4343

4444
[target.'cfg(target_arch = "wasm32")'.dependencies]
4545
js-sys = "0.3"
46+
# https://docs.rs/getrandom/0.2.16/getrandom/index.html#webassembly-support
47+
getrandom = { version = "0.2.16", features = ["js"] }
4648

4749
[dev-dependencies]
4850
wasm-bindgen-test = "0.3.1"

0 commit comments

Comments
 (0)