Skip to content

Commit 02c9159

Browse files
committed
Review updates
1 parent b0ab8d8 commit 02c9159

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

rand_core/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ pub trait TryRngCore {
200200
/// Fill `dest` entirely with random data.
201201
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), Self::Error>;
202202

203-
/// Wrap RNG with the [`PanicOnErr`] wrapper.
204-
fn panic_on_err(self) -> UnwrapErr<Self>
203+
/// Wrap RNG with the [`UnwrapErr`] wrapper.
204+
fn unwrap_err(self) -> UnwrapErr<Self>
205205
where Self: Sized {
206206
UnwrapErr(self)
207207
}
@@ -472,9 +472,6 @@ pub trait SeedableRng: Sized {
472472
}
473473
}
474474

475-
// Implement `RngCore` for references to an `RngCore`.
476-
// Force inlining all functions, so that it is up to the `RngCore`
477-
// implementation and the optimizer to decide on inlining.
478475
impl<'a, R: RngCore + ?Sized> RngCore for &'a mut R {
479476
#[inline(always)]
480477
fn next_u32(&mut self) -> u32 {
@@ -492,12 +489,8 @@ impl<'a, R: RngCore + ?Sized> RngCore for &'a mut R {
492489
}
493490
}
494491

495-
// Implement `TryCryptoRng` for references to a `TryCryptoRng`.
496492
impl<'a, R: CryptoRng + ?Sized> CryptoRng for &'a mut R {}
497493

498-
// Implement `RngCore` for boxed references to an `RngCore`.
499-
// Force inlining all functions, so that it is up to the `RngCore`
500-
// implementation and the optimizer to decide on inlining.
501494
#[cfg(feature = "alloc")]
502495
impl<R: RngCore + ?Sized> RngCore for Box<R> {
503496
#[inline(always)]
@@ -516,7 +509,6 @@ impl<R: RngCore + ?Sized> RngCore for Box<R> {
516509
}
517510
}
518511

519-
// Implement `TryCryptoRng` for boxed references to a `TryCryptoRng`.
520512
#[cfg(feature = "alloc")]
521513
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
522514
impl<R: CryptoRng + ?Sized> CryptoRng for Box<R> {}

src/rngs/std.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ impl SeedableRng for StdRng {
5959
fn from_seed(seed: Self::Seed) -> Self {
6060
StdRng(Rng::from_seed(seed))
6161
}
62-
63-
#[inline(always)]
64-
fn from_rng<R: RngCore>(rng: R) -> Self {
65-
Self(Rng::from_rng(rng))
66-
}
6762
}
6863

6964
impl CryptoRng for StdRng {}

0 commit comments

Comments
 (0)