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