Skip to content

Commit 9f293e5

Browse files
committed
Support wasm32-unknown-emscripten
1 parent 98b940f commit 9f293e5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ fuchsia-zircon = { version = "0.3.2", optional = true }
5050
# use with `--target wasm32-unknown-unknown --features=stdweb`
5151
stdweb = { version = "0.4", optional = true }
5252

53+
[target.wasm32-unknown-emscripten.dependencies]
54+
# use with `--target wasm32-unknown-unknown --features=stdweb`
55+
stdweb = { version = "0.4", optional = true }
56+
5357
[dev-dependencies]
5458
# This is for testing serde, unfortunately we can't specify feature-gated dev
5559
# deps yet, see: https://github.com/rust-lang/cargo/issues/1596

src/rngs/os.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl RngCore for OsRng {
147147

148148
#[cfg(all(unix,
149149
not(target_os = "cloudabi"),
150+
not(all(target_os = "emscripten", feature = "stdweb")),
150151
not(target_os = "freebsd"),
151152
not(target_os = "fuchsia"),
152153
not(target_os = "ios"),
@@ -660,8 +661,7 @@ mod imp {
660661
}
661662

662663
#[cfg(all(target_arch = "wasm32",
663-
not(target_os = "emscripten"),
664-
not(feature = "stdweb")))]
664+
not(any(target_os = "emscripten", feature = "stdweb"))))]
665665
mod imp {
666666
use {Error, ErrorKind};
667667

@@ -681,9 +681,7 @@ mod imp {
681681
}
682682
}
683683

684-
#[cfg(all(target_arch = "wasm32",
685-
not(target_os = "emscripten"),
686-
feature = "stdweb"))]
684+
#[cfg(all(target_arch = "wasm32", feature = "stdweb"))]
687685
mod imp {
688686
use std::mem;
689687
use stdweb::unstable::TryInto;

0 commit comments

Comments
 (0)