Skip to content

Commit 885655d

Browse files
authored
Merge pull request #906 from dbdr/master
Small simplification of doc example
2 parents 19b5a3e + 56d3396 commit 885655d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/rngs/small.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ type Rng = rand_pcg::Pcg32;
5656
/// efficient:
5757
///
5858
/// ```
59-
/// use std::iter;
6059
/// use rand::{SeedableRng, thread_rng};
6160
/// use rand::rngs::SmallRng;
6261
///
@@ -65,9 +64,8 @@ type Rng = rand_pcg::Pcg32;
6564
/// let mut thread_rng = thread_rng();
6665
/// // Create small, cheap to initialize and fast RNGs with random seeds.
6766
/// // One can generally assume this won't fail.
68-
/// let rngs: Vec<SmallRng> = iter::repeat(())
69-
/// .map(|()| SmallRng::from_rng(&mut thread_rng).unwrap())
70-
/// .take(10)
67+
/// let rngs: Vec<SmallRng> = (0..10)
68+
/// .map(|_| SmallRng::from_rng(&mut thread_rng).unwrap())
7169
/// .collect();
7270
/// ```
7371
///

0 commit comments

Comments
 (0)