Skip to content

Commit

Permalink
Fix "could not find sysrand_chunk in super"
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyoung committed Oct 29, 2022
1 parent 0f9084f commit 11aafb0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ once_cell = { version = "1.8.0", default-features = false, features=["std"], opt
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", target_os = "redox", target_os = "solaris"))'.dependencies]
once_cell = { version = "1.8.0", default-features = false, features=["std"] }

[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown", target_env = ""))'.dependencies]
[target.'cfg(all(feature = "wasm32-unknown-unknown", target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown", target_env = ""))'.dependencies]
web-sys = { version = "0.3.51", default-features = false, features = ["Crypto", "Window"], optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
15 changes: 15 additions & 0 deletions src/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,21 @@ mod sysrand_chunk {
}
}

#[cfg(all(
not(feature = "wasm32_unknown_unknown_js"),
target_arch = "wasm32",
target_vendor = "unknown",
target_os = "unknown",
target_env = "",
))]
mod sysrand_chunk {
use crate::error;

pub fn chunk(mut dest: &mut [u8]) -> Result<usize, error::Unspecified> {
unimplemented!()
}
}

#[cfg(windows)]
mod sysrand_chunk {
use crate::{error, polyfill};
Expand Down

0 comments on commit 11aafb0

Please sign in to comment.