diff --git a/benches/kurtosis.rs b/benches/kurtosis.rs index 3796729..80e1f75 100644 --- a/benches/kurtosis.rs +++ b/benches/kurtosis.rs @@ -1,18 +1,12 @@ #![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] -#[macro_use] extern crate bencher; - -use rand_xoshiro; - -use average; - -use bencher::Bencher; +use bencher::{Bencher, benchmark_group, benchmark_main}; /// Create a random vector by sampling from a normal distribution. fn initialize_vec() -> Vec { - use rand::distributions::{Normal, Distribution}; + use rand_distr::{Normal, Distribution}; use rand::SeedableRng; - let normal = Normal::new(2.0, 3.0); + let normal = Normal::new(2.0, 3.0).unwrap(); let n = 1_000_000; let mut values = Vec::with_capacity(n); let mut rng = rand_xoshiro::Xoshiro256StarStar::from_seed( diff --git a/benches/mean.rs b/benches/mean.rs index dc21c32..f50155f 100644 --- a/benches/mean.rs +++ b/benches/mean.rs @@ -1,19 +1,12 @@ #![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] -#[macro_use] extern crate bencher; - -use rand_xoshiro; - -use average; -use stats; - -use bencher::Bencher; +use bencher::{Bencher, benchmark_group, benchmark_main}; /// Create a random vector by sampling from a normal distribution. fn initialize_vec() -> Vec { - use rand::distributions::{Normal, Distribution}; + use rand_distr::{Normal, Distribution}; use rand::SeedableRng; - let normal = Normal::new(2.0, 3.0); + let normal = Normal::new(2.0, 3.0).unwrap(); let n = 1_000_000; let mut values = Vec::with_capacity(n); let mut rng = rand_xoshiro::Xoshiro256StarStar::from_seed( diff --git a/benches/min.rs b/benches/min.rs index 76b7b3a..9f24606 100644 --- a/benches/min.rs +++ b/benches/min.rs @@ -1,17 +1,10 @@ #![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] -#[macro_use] extern crate bencher; - -use rand_xoshiro; - -use average; - - -use bencher::Bencher; +use bencher::{Bencher, benchmark_group, benchmark_main}; /// Create a random vector of random floats in [0, 1]. fn initialize_vec() -> Vec { - use rand::distributions::{Uniform, Distribution}; + use rand_distr::{Uniform, Distribution}; use rand::SeedableRng; let range = Uniform::new(0.0, 1.0); let n = 1_000_000;