From 7bc561c83534eafb4629919f1f778f492e165e9e Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Thu, 13 Mar 2014 17:44:14 -0400 Subject: [PATCH 1/3] Update to latest rust. `std::rand` was moved to it's own crate. Version of rustc: rustc 0.10-pre (4d64441 2014-03-12 15:07:06 -0700) --- src/lib.rs | 1 + src/structs/dmat.rs | 4 ++-- src/structs/dvec.rs | 4 ++-- src/structs/iso.rs | 2 +- src/structs/rot.rs | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 854ab5b0..7976270f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -111,6 +111,7 @@ Feel free to add your project to this list if you happen to use **nalgebra**! extern crate std; extern crate extra; +extern crate rand; extern crate serialize; #[cfg(test)] diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index b60b287e..5386d6c1 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -2,8 +2,8 @@ #[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait. -use std::rand::Rand; -use std::rand; +use rand::Rand; +use rand; use std::num::{One, Zero}; use std::vec; use traits::operations::ApproxEq; diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index 96023415..0e585b22 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -3,8 +3,8 @@ #[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait. use std::num::{Zero, One, Float}; -use std::rand::Rand; -use std::rand; +use rand::Rand; +use rand; use std::vec; use std::vec::{Items, MutItems}; use traits::operations::ApproxEq; diff --git a/src/structs/iso.rs b/src/structs/iso.rs index 5a2bb7a3..fd157ccb 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -3,7 +3,7 @@ #[allow(missing_doc)]; use std::num::{Zero, One}; -use std::rand::{Rand, Rng}; +use rand::{Rand, Rng}; use structs::mat::{Mat3, Mat4, Mat5}; use traits::structure::{Cast, Dim, Col}; use traits::operations::{Inv, ApproxEq}; diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 874820fe..e64e6884 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -3,7 +3,7 @@ #[allow(missing_doc)]; use std::num::{Zero, One}; -use std::rand::{Rand, Rng}; +use rand::{Rand, Rng}; use traits::geometry::{Rotate, Rotation, AbsoluteRotate, RotationMatrix, Transform, ToHomogeneous, Norm, Cross}; use traits::structure::{Cast, Dim, Row, Col}; From 503b567b2726631828a1f15b15617b6362df31a5 Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Thu, 13 Mar 2014 18:20:04 -0400 Subject: [PATCH 2/3] Update to latest Rust. Version of rustc: rustc 0.10-pre (4d64441 2014-03-12 15:07:06 -0700) --- src/bench/mat.rs | 2 +- src/bench/vec.rs | 2 +- src/tests/mat.rs | 2 +- src/tests/vec.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bench/mat.rs b/src/bench/mat.rs index ec782c99..0cdfa2bf 100644 --- a/src/bench/mat.rs +++ b/src/bench/mat.rs @@ -1,4 +1,4 @@ -use std::rand::random; +use rand::random; use test::BenchHarness; use na::{Vec2, Vec3, Vec4, Vec5, Vec6, DVec, Mat2, Mat3, Mat4, Mat5, Mat6, DMat}; diff --git a/src/bench/vec.rs b/src/bench/vec.rs index c4833fda..900a5cf7 100644 --- a/src/bench/vec.rs +++ b/src/bench/vec.rs @@ -1,4 +1,4 @@ -use std::rand::random; +use rand::random; use test::BenchHarness; use na::{Vec2, Vec3, Vec4, Vec5, Vec6}; use na; diff --git a/src/tests/mat.rs b/src/tests/mat.rs index f34a004c..6d623bdc 100644 --- a/src/tests/mat.rs +++ b/src/tests/mat.rs @@ -1,5 +1,5 @@ use std::num::{Float, abs}; -use std::rand::random; +use rand::random; use na::{Vec1, Vec3, Mat1, Mat2, Mat3, Mat4, Mat5, Mat6, Rot3, DMat, DVec, Indexable}; use na; diff --git a/src/tests/vec.rs b/src/tests/vec.rs index ea78040b..d88e85e2 100644 --- a/src/tests/vec.rs +++ b/src/tests/vec.rs @@ -1,4 +1,4 @@ -use std::rand::{random}; +use rand::random; use na::{Vec0, Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; use na::{Mat3, Iterable, IterableMut}; // FIXME: get rid of that use na; From fc10742b5c741f1a25bdb791248f7410d1d13bb2 Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Thu, 13 Mar 2014 19:35:01 -0400 Subject: [PATCH 3/3] Change std::rand to rand in lower_triangular.rs --- src/structs/lower_triangular.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structs/lower_triangular.rs b/src/structs/lower_triangular.rs index 4d435ae6..787bfd3c 100644 --- a/src/structs/lower_triangular.rs +++ b/src/structs/lower_triangular.rs @@ -1,5 +1,5 @@ -use std::rand::Rand; -use std::rand; +use rand::Rand; +use rand; use std::num::{One, Zero}; use std::vec;