Skip to content

Commit e641e7d

Browse files
don't let clippy nag again
1 parent e41807d commit e641e7d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ impl RngCore for CryptoProviderRng {
7272
}
7373

7474
fn fill_bytes(&mut self, dest: &mut [u8]) {
75-
self.try_fill_bytes(dest).unwrap()
75+
self.try_fill_bytes(dest).expect("random bytes should be filled")
7676
}
7777

7878
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand_core::Error> {
7979
CryptoProvider::get_default()
80-
.unwrap()
80+
.expect("provider should be set")
8181
.secure_random
8282
.fill(dest)
8383
.map_err(|_| unsafe { NonZeroU32::new_unchecked(1).into() })
@@ -93,7 +93,6 @@ struct OsRngSecureRandom;
9393
#[cfg(feature = "getrandom")]
9494
impl SecureRandom for OsRngSecureRandom {
9595
fn fill(&self, buf: &mut [u8]) -> Result<(), GetRandomFailed> {
96-
use rand_core::RngCore;
9796
rand_core::OsRng
9897
.try_fill_bytes(buf)
9998
.map_err(|_| GetRandomFailed)

0 commit comments

Comments
 (0)