File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ use crate::Error;
10
10
extern crate std;
11
11
use std:: thread_local;
12
12
13
- use js_sys:: Uint8Array ;
14
- use wasm_bindgen:: { prelude:: * , JsCast } ;
13
+ use js_sys:: { global , Uint8Array } ;
14
+ use wasm_bindgen:: { prelude:: wasm_bindgen , JsCast , JsValue } ;
15
15
16
16
// Maximum is 65536 bytes see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
17
17
const BROWSER_CRYPTO_BUFFER_SIZE : usize = 256 ;
@@ -57,7 +57,7 @@ pub(crate) fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
57
57
}
58
58
59
59
fn getrandom_init ( ) -> Result < RngSource , Error > {
60
- let global: Global = js_sys :: global ( ) . unchecked_into ( ) ;
60
+ let global: Global = global ( ) . unchecked_into ( ) ;
61
61
if is_node ( & global) {
62
62
let crypto = require ( "crypto" ) . map_err ( |_| Error :: NODE_CRYPTO ) ?;
63
63
return Ok ( RngSource :: Node ( crypto) ) ;
You can’t perform that action at this time.
0 commit comments