Skip to content

Commit 429a010

Browse files
authored
Merge pull request #309 from pitdicker/from_rng_bounds
Fix from_rng trait bounds in StdRng and SmallRng
2 parents b84c545 + 96a3a05 commit 429a010

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ impl SeedableRng for StdRng {
841841
StdRng(Hc128Rng::from_seed(seed))
842842
}
843843

844-
fn from_rng<R: Rng>(rng: &mut R) -> Result<Self, Error> {
844+
fn from_rng<R: RngCore>(rng: &mut R) -> Result<Self, Error> {
845845
Hc128Rng::from_rng(rng).map(|rng| StdRng(rng))
846846
}
847847
}
@@ -914,7 +914,7 @@ impl SeedableRng for SmallRng {
914914
SmallRng(XorShiftRng::from_seed(seed))
915915
}
916916

917-
fn from_rng<R: Rng>(rng: &mut R) -> Result<Self, Error> {
917+
fn from_rng<R: RngCore>(rng: &mut R) -> Result<Self, Error> {
918918
XorShiftRng::from_rng(rng).map(|rng| SmallRng(rng))
919919
}
920920
}

0 commit comments

Comments
 (0)