From 018d4a2ec07206972283cefb170b7b898edd9f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 4 Jan 2015 09:37:56 +0100 Subject: [PATCH] Remove glob imports. --- src/lib.rs | 2 +- src/linalg/decompositions.rs | 2 +- src/structs/dmat.rs | 2 +- src/structs/dvec.rs | 2 +- src/structs/iso.rs | 2 +- src/structs/mat.rs | 3 +-- src/structs/pnt.rs | 2 +- src/structs/quat.rs | 2 +- src/structs/rot.rs | 3 +-- src/structs/rot_macros.rs | 6 ------ src/structs/spec/identity.rs | 2 +- src/structs/spec/mat.rs | 2 +- src/structs/spec/vec.rs | 2 +- src/structs/spec/vec0.rs | 2 +- src/structs/vec.rs | 2 +- src/traits/geometry.rs | 3 +-- src/traits/operations.rs | 17 ++++++++--------- src/traits/structure.rs | 2 +- 18 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 15e7bb8c..341d36cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -93,7 +93,7 @@ extern crate "rustc-serialize" as rustc_serialize; extern crate test; use std::cmp; -use std::ops::*; +use std::ops::Neg; pub use traits::{ Absolute, AbsoluteRotate, diff --git a/src/linalg/decompositions.rs b/src/linalg/decompositions.rs index 8100008f..f4b3423e 100644 --- a/src/linalg/decompositions.rs +++ b/src/linalg/decompositions.rs @@ -2,7 +2,7 @@ use traits::operations::{Transpose, ApproxEq}; use traits::structure::{ColSlice, Eye, Indexable, Diag, SquareMat, BaseFloat}; use traits::geometry::Norm; use std::cmp::min; -use std::ops::*; +use std::ops::{Mul, Add, Sub}; /// Get the householder matrix corresponding to a reflexion to the hyperplane /// defined by `vec`. It can be a reflexion contained in a subspace. diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index f340f088..2ff5c362 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -6,7 +6,7 @@ use std::cmp; use std::iter::repeat; use std::rand::Rand; use std::rand; -use std::ops::*; +use std::ops::{Add, Sub, Mul, Div, Index, IndexMut}; use traits::operations::ApproxEq; use std::mem; use structs::dvec::DVec; diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index 919b8f2b..729cc81b 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -7,7 +7,7 @@ use std::rand; use std::slice::{Iter, IterMut}; use std::iter::FromIterator; use std::iter::repeat; -use std::ops::*; +use std::ops::{Add, Sub, Mul, Div, Neg, Index, IndexMut}; use traits::operations::{ApproxEq, Axpy}; use traits::geometry::{Dot, Norm}; use traits::structure::{Iterable, IterableMut, Indexable, Shape, BaseFloat, BaseNum, Zero, One}; diff --git a/src/structs/iso.rs b/src/structs/iso.rs index f4a78c11..1005cb96 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -2,7 +2,7 @@ #![allow(missing_docs)] -use std::ops::*; +use std::ops::{Add, Sub, Mul}; use std::rand::{Rand, Rng}; use structs::mat::{Mat3, Mat4, Mat5}; diff --git a/src/structs/mat.rs b/src/structs/mat.rs index ce8b5216..64e4460e 100644 --- a/src/structs/mat.rs +++ b/src/structs/mat.rs @@ -2,8 +2,7 @@ #![allow(missing_docs)] // we allow missing to avoid having to document the mij components. -use std::ops::*; - +use std::ops::{Add, Sub, Mul, Div, Index, IndexMut}; use std::mem; use traits::operations::ApproxEq; use std::slice::{Iter, IterMut}; diff --git a/src/structs/pnt.rs b/src/structs/pnt.rs index e0425946..4995c954 100644 --- a/src/structs/pnt.rs +++ b/src/structs/pnt.rs @@ -5,7 +5,7 @@ use std::mem; use std::slice::{Iter, IterMut}; use std::iter::{Iterator, FromIterator}; -use std::ops::*; +use std::ops::{Add, Sub, Mul, Div, Neg, Index, IndexMut}; use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv}; use traits::structure::{Cast, Dim, Indexable, Iterable, IterableMut, PntAsVec, Shape, diff --git a/src/structs/quat.rs b/src/structs/quat.rs index 131011ae..d71f71d3 100644 --- a/src/structs/quat.rs +++ b/src/structs/quat.rs @@ -6,7 +6,7 @@ use std::mem; use std::num; use std::rand::{Rand, Rng}; use std::slice::{Iter, IterMut}; -use std::ops::*; +use std::ops::{Add, Sub, Mul, Div, Neg, Index, IndexMut}; use std::iter::FromIterator; use structs::{Vec3, Pnt3, Rot3, Mat3}; use traits::operations::{ApproxEq, Inv, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul, diff --git a/src/structs/rot.rs b/src/structs/rot.rs index d698f4be..58aae541 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -2,8 +2,7 @@ #![allow(missing_docs)] -use std::ops::*; - +use std::ops::{Mul, Neg, Index}; use std::rand::{Rand, Rng}; use traits::geometry::{Rotate, Rotation, AbsoluteRotate, RotationMatrix, Transform, ToHomogeneous, Norm, Cross}; diff --git a/src/structs/rot_macros.rs b/src/structs/rot_macros.rs index d6f6d81f..2120ace4 100644 --- a/src/structs/rot_macros.rs +++ b/src/structs/rot_macros.rs @@ -228,12 +228,6 @@ macro_rules! index_impl( &self.submat[*i] } } - - impl IndexMut<(uint, uint), N> for $t { - fn index_mut(&mut self, i: &(uint, uint)) -> &mut N { - &mut self.submat[*i] - } - } ) ); diff --git a/src/structs/spec/identity.rs b/src/structs/spec/identity.rs index 0af21f3b..06890960 100644 --- a/src/structs/spec/identity.rs +++ b/src/structs/spec/identity.rs @@ -1,9 +1,9 @@ +use std::ops::Mul; use structs::mat; use traits::operations::{Inv, Transpose}; use traits::structure::{Zero, One}; use traits::geometry::{Translation, Translate, Rotation, Rotate, Transformation, Transform, AbsoluteRotate}; -use std::ops::*; impl One for mat::Identity { #[inline] diff --git a/src/structs/spec/mat.rs b/src/structs/spec/mat.rs index ed3981df..e45ad6c8 100644 --- a/src/structs/spec/mat.rs +++ b/src/structs/spec/mat.rs @@ -1,9 +1,9 @@ +use std::ops::{Add, Mul}; use structs::vec::{Vec2, Vec3}; use structs::pnt::{Pnt2, Pnt3}; use structs::mat::{Mat1, Mat2, Mat3}; use traits::operations::{Inv, Det, ApproxEq}; use traits::structure::{Row, Col, BaseNum}; -use std::ops::*; // some specializations: impl> Inv for Mat1 { diff --git a/src/structs/spec/vec.rs b/src/structs/spec/vec.rs index 318bb3d1..34517851 100644 --- a/src/structs/spec/vec.rs +++ b/src/structs/spec/vec.rs @@ -1,8 +1,8 @@ +use std::ops::{Sub, Mul, Neg}; use traits::structure::{Cast, Row, Basis, BaseFloat, Zero, One}; use traits::geometry::{Norm, Cross, CrossMatrix, UniformSphereSample}; use structs::vec::{Vec1, Vec2, Vec3, Vec4}; use structs::mat::Mat3; -use std::ops::*; impl + Sub> Cross> for Vec2 { #[inline] diff --git a/src/structs/spec/vec0.rs b/src/structs/spec/vec0.rs index 8ac5cc20..fe1607ed 100644 --- a/src/structs/spec/vec0.rs +++ b/src/structs/spec/vec0.rs @@ -1,7 +1,7 @@ +use std::ops::{Add, Sub, Mul, Div, Neg, Index, IndexMut}; use std::mem; use std::slice::{Iter, IterMut}; use std::iter::{Iterator, FromIterator}; -use std::ops::*; use traits::operations::ApproxEq; use traits::structure::{Iterable, IterableMut, Indexable, Basis, Dim, Shape, BaseFloat, BaseNum, Zero, One, Bounded}; diff --git a/src/structs/vec.rs b/src/structs/vec.rs index 72fbf3a6..e7e75fd0 100644 --- a/src/structs/vec.rs +++ b/src/structs/vec.rs @@ -2,10 +2,10 @@ #![allow(missing_docs)] // we allow missing to avoid having to document the dispatch traits. +use std::ops::{Add, Sub, Mul, Div, Neg, Index, IndexMut}; use std::mem; use std::slice::{Iter, IterMut}; use std::iter::{Iterator, FromIterator}; -use std::ops::*; use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Absolute}; use traits::geometry::{Transform, Rotate, FromHomogeneous, ToHomogeneous, Dot, Norm, diff --git a/src/traits/geometry.rs b/src/traits/geometry.rs index 0b276f8c..cb52251b 100644 --- a/src/traits/geometry.rs +++ b/src/traits/geometry.rs @@ -1,7 +1,6 @@ //! Traits of operations having a well-known or explicit geometric meaning. -use std::ops::*; - +use std::ops::Neg; use traits::structure::{BaseFloat, Mat}; /// Trait of object which represent a translation, and to wich new translation diff --git a/src/traits/operations.rs b/src/traits/operations.rs index d8fe9969..d731d13f 100644 --- a/src/traits/operations.rs +++ b/src/traits/operations.rs @@ -1,9 +1,8 @@ //! Low level operations on vectors and matrices. use std::num::{Float, SignedInt}; -use std::ops::*; -use std::cmp::*; -use std::cmp::Ordering::*; +use std::ops::Mul; +use std::cmp::Ordering; use traits::structure::SquareMat; /// Result of a partial ordering. @@ -53,9 +52,9 @@ impl POrdering { /// Creates a `POrdering` from an `Ordering`. pub fn from_ordering(ord: Ordering) -> POrdering { match ord { - Less => POrdering::PartialLess, - Equal => POrdering::PartialEqual, - Greater => POrdering::PartialGreater + Ordering::Less => POrdering::PartialLess, + Ordering::Equal => POrdering::PartialEqual, + Ordering::Greater => POrdering::PartialGreater } } @@ -64,9 +63,9 @@ impl POrdering { /// Returns `None` if `self` is `NotComparable`. pub fn to_ordering(self) -> Option { match self { - POrdering::PartialLess => Some(Less), - POrdering::PartialEqual => Some(Equal), - POrdering::PartialGreater => Some(Greater), + POrdering::PartialLess => Some(Ordering::Less), + POrdering::PartialEqual => Some(Ordering::Equal), + POrdering::PartialGreater => Some(Ordering::Greater), POrdering::NotComparable => None } } diff --git a/src/traits/structure.rs b/src/traits/structure.rs index 85227f4c..3d0f598f 100644 --- a/src/traits/structure.rs +++ b/src/traits/structure.rs @@ -4,7 +4,7 @@ use std::f32; use std::f64; use std::num::{Int, Float, FloatMath}; use std::slice::{Iter, IterMut}; -use std::ops::*; +use std::ops::{Add, Sub, Mul, Div, Neg, Rem, Index, IndexMut}; use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute}; use traits::geometry::{Dot, Norm, Orig};