Skip to content

Commit 1c34c14

Browse files
authored
password-hash: remove unnecessary expect (#2079)
1 parent e8af70d commit 1c34c14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

password-hash/src/salt.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ impl SaltString {
197197
/// Generate a random B64-encoded [`SaltString`] from [`CryptoRng`].
198198
#[cfg(feature = "rand_core")]
199199
pub fn from_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Self {
200-
Self::try_from_rng(rng).expect("RNG failure")
200+
let Ok(out) = Self::try_from_rng(rng);
201+
out
201202
}
202203

203204
/// Generate a random B64-encoded [`SaltString`] from [`TryCryptoRng`].

0 commit comments

Comments
 (0)