diff options
Diffstat (limited to 'vendor/criterion/src/stats/test.rs')
-rwxr-xr-x | vendor/criterion/src/stats/test.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/criterion/src/stats/test.rs b/vendor/criterion/src/stats/test.rs new file mode 100755 index 000000000..9e13f3084 --- /dev/null +++ b/vendor/criterion/src/stats/test.rs @@ -0,0 +1,16 @@ +use rand::distributions::{Distribution, Standard}; +use rand::prelude::*; +use rand::rngs::StdRng; + +pub fn vec<T>(size: usize, start: usize) -> Option<Vec<T>> +where + Standard: Distribution<T>, +{ + if size > start + 2 { + let mut rng = StdRng::from_entropy(); + + Some((0..size).map(|_| rng.gen()).collect()) + } else { + None + } +} |