diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index 0336c5bc2a..f731faf191 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -254,7 +254,7 @@ pub trait TryRngCore { // Note that, unfortunately, this blanket impl prevents us from implementing // `TryRngCore` for types which can be dereferenced to `TryRngCore`, i.e. `TryRngCore` // will not be automatically implemented for `&mut R`, `Box`, etc. -impl TryRngCore for R { +impl TryRngCore for R { type Error = core::convert::Infallible; #[inline] @@ -290,14 +290,14 @@ impl TryRngCore for R { /// (like [`OsRng`]) or if the `default()` instance uses a strong, fresh seed. pub trait TryCryptoRng: TryRngCore {} -impl TryCryptoRng for R {} +impl TryCryptoRng for R {} /// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`] /// by panicking on potential errors. #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash)] -pub struct UnwrapErr(pub R); +pub struct UnwrapErr(pub R); -impl RngCore for UnwrapErr { +impl RngCore for UnwrapErr { #[inline] fn next_u32(&mut self) -> u32 { self.0.try_next_u32().unwrap() @@ -314,14 +314,14 @@ impl RngCore for UnwrapErr { } } -impl CryptoRng for UnwrapErr {} +impl CryptoRng for UnwrapErr {} /// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`] /// by panicking on potential errors. #[derive(Debug, Eq, PartialEq, Hash)] pub struct UnwrapMut<'r, R: TryRngCore + ?Sized>(pub &'r mut R); -impl RngCore for UnwrapMut<'_, R> { +impl RngCore for UnwrapMut<'_, R> { #[inline] fn next_u32(&mut self) -> u32 { self.0.try_next_u32().unwrap() @@ -338,7 +338,7 @@ impl RngCore for UnwrapMut<'_, R> { } } -impl CryptoRng for UnwrapMut<'_, R> {} +impl CryptoRng for UnwrapMut<'_, R> {} /// A random number generator that can be explicitly seeded. ///