Skip to content

Commit 2ac0d63

Browse files
committed
fix(cryptids): rejigger crng sequencing
1 parent a005aa6 commit 2ac0d63

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

libraries/cryptids/src/crng.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cfg_feature_std! {
2424
}
2525
#[cfg(target_os = "linux")]
2626
{
27-
std::fs::File::open("/dev/urandom").ok()?
27+
return std::fs::File::open("/dev/urandom").ok()?
2828
.read_be_u64().ok()
2929
}
3030
#[cfg(target_arch = "wasm32")]
@@ -33,9 +33,8 @@ cfg_feature_std! {
3333
let w = web_sys::window()?;
3434
let c = w.crypto().ok()?;
3535
c.get_random_values_with_u8_array(&mut v).ok()?;
36-
Some(u64::from_be_bytes(v))
36+
return Some(u64::from_be_bytes(v))
3737
}
38-
#[cfg(not(any(target_arch = "x86_64", target_arch = "wasm32")))]
3938
None
4039
}
4140

0 commit comments

Comments
 (0)