Debian Codegraph @

debian/missing-sources/criterion/src/stats/test.rs

raw
1 use rand::distributions::Standard;
2 use rand::prelude::*;
3
4 pub fn vec<T>(size: usize, start: usize) -> Option<Vec<T>>
5 where
6 Standard: Distribution<T>,
7 {
8 if size > start + 2 {
9 let mut rng = StdRng::from_entropy();
10
11 Some((0..size).map(|_| rng.gen()).collect())
12 } else {
13 None
14 }
15 }