File tree 4 files changed +2
-7
lines changed 4 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 10
10
#[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
11
11
compile_error ! ( "This crate is only for the `wasm32-unknown-unknown` target" ) ;
12
12
13
- use core:: mem;
14
13
use std:: sync:: Once ;
15
14
16
15
use stdweb:: js;
@@ -26,7 +25,6 @@ enum RngSource {
26
25
register_custom_getrandom ! ( getrandom_inner) ;
27
26
28
27
fn getrandom_inner ( dest : & mut [ u8 ] ) -> Result < ( ) , Error > {
29
- assert_eq ! ( mem:: size_of:: <usize >( ) , 4 ) ;
30
28
static ONCE : Once = Once :: new ( ) ;
31
29
static mut RNG_SOURCE : Result < RngSource , Error > = Ok ( RngSource :: Node ) ;
32
30
Original file line number Diff line number Diff line change 10
10
compile_error ! ( "This crate is only for the `wasm32-unknown-unknown` target" ) ;
11
11
12
12
use core:: cell:: RefCell ;
13
- use core:: mem;
14
13
use std:: thread_local;
15
14
16
15
use wasm_bindgen:: prelude:: * ;
@@ -32,8 +31,6 @@ thread_local!(
32
31
register_custom_getrandom ! ( getrandom_inner) ;
33
32
34
33
fn getrandom_inner ( dest : & mut [ u8 ] ) -> Result < ( ) , Error > {
35
- assert_eq ! ( mem:: size_of:: <usize >( ) , 4 ) ;
36
-
37
34
RNG_SOURCE . with ( |f| {
38
35
let mut source = f. borrow_mut ( ) ;
39
36
if source. is_none ( ) {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ fn wait_until_rng_ready() -> Result<(), Error> {
99
99
// A negative timeout means an infinite timeout.
100
100
let res = unsafe { libc:: poll ( & mut pfd, 1 , -1 ) } ;
101
101
if res >= 0 {
102
- assert_eq ! ( res, 1 ) ; // We only used one fd, and cannot timeout.
102
+ debug_assert_eq ! ( res, 1 ) ; // We only used one fd, and cannot timeout.
103
103
return Ok ( ( ) ) ;
104
104
}
105
105
let err = crate :: util_libc:: last_os_error ( ) ;
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ cfg_if! {
108
108
109
109
// SAFETY: path must be null terminated, FD must be manually closed.
110
110
pub unsafe fn open_readonly ( path : & str ) -> Result < libc:: c_int , Error > {
111
- debug_assert ! ( path. as_bytes( ) . last( ) == Some ( & 0 ) ) ;
111
+ debug_assert_eq ! ( path. as_bytes( ) . last( ) , Some ( & 0 ) ) ;
112
112
let fd = open ( path. as_ptr ( ) as * const _ , libc:: O_RDONLY | libc:: O_CLOEXEC ) ;
113
113
if fd < 0 {
114
114
return Err ( last_os_error ( ) ) ;
You can’t perform that action at this time.
0 commit comments