From c42319df03527fd62aa9de6a074af7fc4cdd8e12 Mon Sep 17 00:00:00 2001 From: bluss Date: Mon, 9 Sep 2019 19:57:50 +0200 Subject: [PATCH 1/2] DOC: In ndarray-rand, skip "extern crate" lines in examples These are fortunately not needed anymore. --- ndarray-rand/src/lib.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ndarray-rand/src/lib.rs b/ndarray-rand/src/lib.rs index 69d088096..82fe9e36c 100644 --- a/ndarray-rand/src/lib.rs +++ b/ndarray-rand/src/lib.rs @@ -50,10 +50,6 @@ where /// overflows usize. /// /// ``` - /// extern crate rand; - /// extern crate ndarray; - /// extern crate ndarray_rand; - /// /// use rand::distributions::Uniform; /// use ndarray::Array; /// use ndarray_rand::RandomExt; @@ -109,10 +105,6 @@ where /// A wrapper type that allows casting f64 distributions to f32 /// /// ``` -/// extern crate rand; -/// extern crate ndarray; -/// extern crate ndarray_rand; -/// /// use rand::distributions::Normal; /// use ndarray::Array; /// use ndarray_rand::{RandomExt, F32}; From e057399410a3eff2460fce635d381ebecaa2569f Mon Sep 17 00:00:00 2001 From: bluss Date: Mon, 9 Sep 2019 20:03:59 +0200 Subject: [PATCH 2/2] DOC: Update ndarray-rand to use rand_distr This is the non-deprecated version of the same functionality, so we'll have to use rand_distr for our examples. --- ndarray-rand/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ndarray-rand/src/lib.rs b/ndarray-rand/src/lib.rs index 82fe9e36c..f2742f12f 100644 --- a/ndarray-rand/src/lib.rs +++ b/ndarray-rand/src/lib.rs @@ -50,7 +50,7 @@ where /// overflows usize. /// /// ``` - /// use rand::distributions::Uniform; + /// use rand_distr::Uniform; /// use ndarray::Array; /// use ndarray_rand::RandomExt; /// @@ -105,12 +105,12 @@ where /// A wrapper type that allows casting f64 distributions to f32 /// /// ``` -/// use rand::distributions::Normal; +/// use rand_distr::Normal; /// use ndarray::Array; /// use ndarray_rand::{RandomExt, F32}; /// /// # fn main() { -/// let a = Array::random((2, 5), F32(Normal::new(0., 1.))); +/// let a = Array::random((2, 5), F32(Normal::new(0., 1.).unwrap())); /// println!("{:8.4}", a); /// // Example Output: /// // [[ -0.6910, 1.1730, 1.0902, -0.4092, -1.7340],