Skip to content

Commit

Permalink
Make StdRng wrap Hc128Rng
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Dec 16, 2017
1 parent b9f7123 commit 66e5d15
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ pub use distributions::{Distribution, Default, Rand};
#[cfg(feature="std")]
pub use thread_local::{ThreadRng, thread_rng, random, random_with};

use prng::IsaacWordRng;
use distributions::range::Range;

/// Copied from `arrayref` crate
Expand Down Expand Up @@ -459,7 +458,7 @@ impl<R: Rng+?Sized> Sample for R {
/// not support `SeedableRng`.
#[derive(Clone, Debug)]
pub struct StdRng {
rng: IsaacWordRng,
rng: prng::Hc128Rng,
}

impl Rng for StdRng {
Expand All @@ -483,7 +482,7 @@ impl Rng for StdRng {

impl SeedFromRng for StdRng {
fn from_rng<R: Rng>(other: R) -> Result<Self, Error> {
IsaacWordRng::from_rng(other).map(|rng| StdRng{ rng })
prng::Hc128Rng::from_rng(other).map(|rng| StdRng{ rng })
}
}

Expand Down

0 comments on commit 66e5d15

Please sign in to comment.