aboutsummaryrefslogtreecommitdiff
path: root/src/stats/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stats/test.rs')
-rwxr-xr-xsrc/stats/test.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stats/test.rs b/src/stats/test.rs
new file mode 100755
index 0000000..9e13f30
--- /dev/null
+++ b/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
+ }
+}