From afb6317893f2fb8272d48cfc6c5c2138fd9d83f0 Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Fri, 20 Jul 2018 16:10:12 +0200 Subject: [PATCH] Fix Xargo build. --- src/base/construction.rs | 16 +++++++++++----- src/base/default_allocator.rs | 2 +- src/base/matrix_alga.rs | 5 +++-- src/base/matrix_vec.rs | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/base/construction.rs b/src/base/construction.rs index 787ca297..652b3eb6 100644 --- a/src/base/construction.rs +++ b/src/base/construction.rs @@ -4,14 +4,16 @@ use base::storage::Owned; use quickcheck::{Arbitrary, Gen}; use num::{Bounded, One, Zero}; -#[cfg(feature = "std")] -use rand::{self, distributions::StandardNormal}; use rand::distributions::{Distribution, Standard}; use rand::Rng; +#[cfg(feature = "std")] +use rand::{self, distributions::StandardNormal}; use std::iter; use typenum::{self, Cmp, Greater}; -use alga::general::{ClosedAdd, ClosedMul, Real}; +#[cfg(feature = "std")] +use alga::general::Real; +use alga::general::{ClosedAdd, ClosedMul}; use base::allocator::Allocator; use base::dimension::{Dim, DimName, Dynamic, U1, U2, U3, U4, U5, U6}; @@ -510,11 +512,15 @@ where /// Generate a uniformly distributed random unit vector. #[inline] fn sample<'a, G: Rng + ?Sized>(&self, rng: &'a mut G) -> Unit> { - Unit::new_normalize(VectorN::from_distribution_generic(D::name(), U1, &mut StandardNormal, rng)) + Unit::new_normalize(VectorN::from_distribution_generic( + D::name(), + U1, + &mut StandardNormal, + rng, + )) } } - /* * * Constructors for small matrices and vectors. diff --git a/src/base/default_allocator.rs b/src/base/default_allocator.rs index e4692a14..e097f3a2 100644 --- a/src/base/default_allocator.rs +++ b/src/base/default_allocator.rs @@ -9,7 +9,7 @@ use std::ops::Mul; use std::ptr; #[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::Vec; +use alloc::vec::Vec; use generic_array::ArrayLength; use typenum::Prod; diff --git a/src/base/matrix_alga.rs b/src/base/matrix_alga.rs index 9c12e227..8593474e 100644 --- a/src/base/matrix_alga.rs +++ b/src/base/matrix_alga.rs @@ -1,5 +1,5 @@ #[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::Vec; +use alloc::vec::Vec; use num::{One, Zero}; @@ -411,7 +411,8 @@ where for i in 0..shape.0.value() * shape.1.value() { unsafe { - let mj = self.data + let mj = self + .data .get_unchecked_linear(i) .meet_join(other.data.get_unchecked_linear(i)); *mres.data.get_unchecked_linear_mut(i) = mj.0; diff --git a/src/base/matrix_vec.rs b/src/base/matrix_vec.rs index 7f5fdd35..723e10fb 100644 --- a/src/base/matrix_vec.rs +++ b/src/base/matrix_vec.rs @@ -3,7 +3,7 @@ use std::io::{Result as IOResult, Write}; use std::ops::Deref; #[cfg(all(feature = "alloc", not(feature = "std")))] -use alloc::Vec; +use alloc::vec::Vec; use base::allocator::Allocator; use base::default_allocator::DefaultAllocator;