diff --git a/examples/rayon-monte-carlo.rs b/examples/rayon-monte-carlo.rs index 041f7379c4..f0e7114a65 100755 --- a/examples/rayon-monte-carlo.rs +++ b/examples/rayon-monte-carlo.rs @@ -55,8 +55,8 @@ fn main() { .into_par_iter() .map(|i| { let mut rng = ChaCha8Rng::seed_from_u64(SEED); - // We chose ChaCha because it's fast, has suitable statical properties for simulation, - // and because it supports this set_stream() api, which lets us chose a different stream + // We chose ChaCha because it's fast, has suitable statistical properties for simulation, + // and because it supports this set_stream() api, which lets us choose a different stream // per work item. ChaCha supports 2^64 independent streams. rng.set_stream(i); let mut count = 0; @@ -69,7 +69,10 @@ fn main() { } count }) - .reduce(|| 0usize, |a, b| a + b); + .sum::(); + + // assert this is deterministic + assert_eq!(in_circle, 7852263); // prints something close to 3.14159... println!(