#![allow(dead_code)] use criterion::Criterion; use rand::{thread_rng, Rand, Rng, XorShiftRng}; pub fn vec() -> Vec where T: Rand, { const SIZE: usize = 1_000_000; vec_sized(SIZE).unwrap() } pub fn vec_sized(size: usize) -> Option> where T: Rand, { let mut rng: XorShiftRng = thread_rng().gen(); Some((0..size).map(|_| rng.gen()).collect()) }