22
22
//! | Dragonfly BSD | `*‑dragonfly` | [`/dev/random`][8]
23
23
//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom()`][9] if available, otherwise [`/dev/random`][10]
24
24
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`][11]
25
- //! | Redox | `*‑cloudabi` | [`rand:`][12]
26
- //! | CloudABI | `*‑redox` | [`cloudabi_sys_random_get`][13]
25
+ //! | Redox | `*‑redox` | [`rand:`][12]
27
26
//! | Haiku | `*‑haiku` | `/dev/random` (identical to `/dev/urandom`)
28
27
//! | SGX | `x86_64‑*‑sgx` | [RDRAND][18]
29
28
//! | VxWorks | `*‑wrs‑vxworks‑*` | `randABytes` after checking entropy pool initialization with `randSecure`
68
67
//! that you are building for an environment containing JavaScript, and will
69
68
//! call the appropriate methods. Both web browser (main window and Web Workers)
70
69
//! and Node.js environments are supported, invoking the methods
71
- //! [described above](#supported-targets). This crate can be built with either
72
- //! the [wasm-bindgen](https://github.com/rust-lang/rust-bindgen) or
73
- //! [cargo-web](https://github.com/koute/cargo-web) toolchains.
70
+ //! [described above](#supported-targets) using the
71
+ //! [wasm-bindgen](https://github.com/rust-lang/rust-bindgen) toolchain.
74
72
//!
75
73
//! This feature has no effect on targets other than `wasm32-unknown-unknown`.
76
74
//!
132
130
//! [10]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
133
131
//! [11]: https://fuchsia.dev/fuchsia-src/zircon/syscalls/cprng_draw
134
132
//! [12]: https://github.com/redox-os/randd/blob/master/src/main.rs
135
- //! [13]: https://github.com/nuxinl/cloudabi#random_get
136
133
//! [14]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
137
134
//! [15]: https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
138
135
//! [16]: #webassembly-support
149
146
) ]
150
147
#![ no_std]
151
148
#![ warn( rust_2018_idioms, unused_lifetimes, missing_docs) ]
149
+ // `matches!` macro was added only in Rust 1.42, which is bigger than our MSRV
150
+ #![ allow( clippy:: match_like_matches_macro) ]
152
151
153
152
#[ macro_use]
154
153
extern crate cfg_if;
@@ -183,8 +182,6 @@ cfg_if! {
183
182
} else if #[ cfg( any( target_os = "freebsd" , target_os = "netbsd" ) ) ] {
184
183
mod util_libc;
185
184
#[ path = "bsd_arandom.rs" ] mod imp;
186
- } else if #[ cfg( target_os = "cloudabi" ) ] {
187
- #[ path = "cloudabi.rs" ] mod imp;
188
185
} else if #[ cfg( target_os = "fuchsia" ) ] {
189
186
#[ path = "fuchsia.rs" ] mod imp;
190
187
} else if #[ cfg( target_os = "ios" ) ] {
@@ -210,9 +207,7 @@ cfg_if! {
210
207
#[ path = "rdrand.rs" ] mod imp;
211
208
} else if #[ cfg( all( feature = "js" ,
212
209
target_arch = "wasm32" , target_os = "unknown" ) ) ] {
213
- #[ cfg_attr( cargo_web, path = "stdweb.rs" ) ]
214
- #[ cfg_attr( not( cargo_web) , path = "wasm-bindgen.rs" ) ]
215
- mod imp;
210
+ #[ path = "js.rs" ] mod imp;
216
211
} else if #[ cfg( feature = "custom" ) ] {
217
212
use custom as imp;
218
213
} else {
0 commit comments