4545//! features are activated for this crate. Note that if both features are
4646//! enabled `wasm-bindgen` will be used. If neither feature is enabled,
4747//! `getrandom` will always fail.
48- //!
48+ //!
4949//! The WASI target `wasm32-wasi` uses the `__wasi_random_get` function defined
5050//! by the WASI standard.
51- //!
51+ //!
5252//!
5353//! ## Early boot
5454//!
115115//! [16]: #support-for-webassembly-and-amsjs
116116//! [17]: https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md#__wasi_random_get
117117
118- #![ doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" ,
119- html_favicon_url = "https://www.rust-lang.org/favicon.ico" ,
120- html_root_url = "https://rust-random.github.io/rand/" ) ]
118+ #![ doc(
119+ html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png" ,
120+ html_favicon_url = "https://www.rust-lang.org/favicon.ico" ,
121+ html_root_url = "https://rust-random.github.io/rand/"
122+ ) ]
121123#![ no_std]
122- #![ cfg_attr( feature = "stdweb" , recursion_limit= "128" ) ]
124+ #![ cfg_attr( feature = "stdweb" , recursion_limit = "128" ) ]
123125
124126#[ cfg( feature = "log" ) ]
125127#[ macro_use]
126128extern crate log;
127129#[ cfg( not( feature = "log" ) ) ]
128130#[ allow( unused) ]
129- macro_rules! error { ( $( $x: tt) * ) => ( ) }
131+ macro_rules! error {
132+ ( $( $x: tt) * ) => { } ;
133+ }
130134
131135// temp fix for stdweb
132136#[ cfg( target_arch = "wasm32" ) ]
133137extern crate std;
134138
139+ mod error;
135140#[ cfg( any(
136141 target_os = "android" ,
137142 target_os = "netbsd" ,
@@ -141,13 +146,9 @@ extern crate std;
141146 target_os = "dragonfly" ,
142147 target_os = "haiku" ,
143148 target_os = "linux" ,
144- all(
145- target_arch = "wasm32" ,
146- not( target_os = "wasi" )
147- ) ,
149+ all( target_arch = "wasm32" , not( target_os = "wasi" ) ) ,
148150) ) ]
149151mod utils;
150- mod error;
151152pub use crate :: error:: Error ;
152153
153154// System-specific implementations.
@@ -159,13 +160,14 @@ macro_rules! mod_use {
159160 #[ $cond]
160161 mod $module;
161162 #[ $cond]
162- use crate :: $module:: { getrandom_inner , error_msg_inner } ;
163- }
163+ use crate :: $module:: { error_msg_inner , getrandom_inner } ;
164+ } ;
164165}
165166
166167#[ cfg( any(
167168 feature = "std" ,
168- windows, unix,
169+ windows,
170+ unix,
169171 target_os = "cloudabi" ,
170172 target_os = "redox" ,
171173 target_arch = "wasm32" ,
@@ -246,7 +248,6 @@ mod_use!(
246248 dummy
247249) ;
248250
249-
250251/// Fill `dest` with random bytes from the system's preferred random number
251252/// source.
252253///
0 commit comments