Skip to content

Commit

Permalink
SmallRng: do not expect thread_rng
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Dec 30, 2023
1 parent 87f1f5b commit 8ceba5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rngs/small.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
//! A small fast RNG
use rand_core::{Error, RngCore, SeedableRng};
use crate::thread_rng;

#[cfg(target_pointer_width = "64")]
type Rng = super::xoshiro256plusplus::Xoshiro256PlusPlus;
Expand Down Expand Up @@ -82,9 +81,10 @@ impl SmallRng {
}

/// Construct an instance seeded from the thread-local RNG
#[cfg(all(feature = "std", feature = "std_rng", feature = "getrandom"))]
#[inline(always)]
pub fn from_thread_rng() -> Result<Self, Error> {
Rng::from_rng(thread_rng()).map(SmallRng)
Rng::from_rng(crate::thread_rng()).map(SmallRng)
}

/// Construct an instance from a `u64` seed
Expand Down

0 comments on commit 8ceba5d

Please sign in to comment.