From 837b550238aa671a591ccf282dddeab29cadb206 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:42 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/criterion/src/stats/test.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 vendor/criterion/src/stats/test.rs (limited to 'vendor/criterion/src/stats/test.rs') 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(size: usize, start: usize) -> Option> +where + Standard: Distribution, +{ + if size > start + 2 { + let mut rng = StdRng::from_entropy(); + + Some((0..size).map(|_| rng.gen()).collect()) + } else { + None + } +} -- cgit v1.2.3