Skip to content

Commit 0217ad9

Browse files
authored
Add TryRngCore and TryCryptoRng traits (rust-random#1424)
This reworks fallibility, replacing the fixed `Error` type.
1 parent e79f6b3 commit 0217ad9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/uniformity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn unit_sphere() {
2323
let h = Histogram100::with_const_width(-1., 1.);
2424
let mut histograms = [h.clone(), h.clone(), h];
2525
let dist = rand_distr::UnitSphere;
26-
let mut rng = rand_pcg::Pcg32::from_entropy();
26+
let mut rng = rand_pcg::Pcg32::from_os_rng();
2727
for _ in 0..N_SAMPLES {
2828
let v: [f64; 3] = dist.sample(&mut rng);
2929
for i in 0..N_DIM {
@@ -51,7 +51,7 @@ fn unit_circle() {
5151
use core::f64::consts::PI;
5252
let mut h = Histogram100::with_const_width(-PI, PI);
5353
let dist = rand_distr::UnitCircle;
54-
let mut rng = rand_pcg::Pcg32::from_entropy();
54+
let mut rng = rand_pcg::Pcg32::from_os_rng();
5555
for _ in 0..N_SAMPLES {
5656
let v: [f64; 2] = dist.sample(&mut rng);
5757
h.add(v[0].atan2(v[1])).unwrap();

0 commit comments

Comments
 (0)