From 1b31304a9eff5429ccc40bd1319ee5cbf6626422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 31 Aug 2013 11:41:32 +0200 Subject: [PATCH] Rework the trait exports. `use vec::an_operation` will import a vector-applicable operation trait. `use mat::an_operation` will import a matrix-applicable operation trait. --- src/mat.rs | 19 +++++++------------ src/mat_spec.rs | 4 +--- src/vec.rs | 28 +++++++++++++++++----------- src/vec_spec.rs | 8 +------- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/src/mat.rs b/src/mat.rs index 075fc313..8d915dcd 100644 --- a/src/mat.rs +++ b/src/mat.rs @@ -5,27 +5,22 @@ use std::num::{One, Zero}; use std::cmp::ApproxEq; use std::vec::{VecIterator, VecMutIterator}; use vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; -use traits::dim::Dim; -use traits::inv::Inv; -use traits::transpose::Transpose; -use traits::rlmul::{RMul, LMul}; -use traits::transformation::Transform; -use traits::homogeneous::{FromHomogeneous, ToHomogeneous}; -use traits::indexable::Indexable; -use traits::column::Column; -use traits::row::Row; -use traits::iterable::{Iterable, IterableMut}; -use traits::outer::Outer; -use traits::scalar_op::{ScalarAdd, ScalarSub}; +pub use traits::dim::*; +pub use traits::indexable::*; +pub use traits::iterable::*; +pub use traits::outer::*; +pub use traits::scalar_op::*; pub use traits::mat_cast::*; pub use traits::column::*; +pub use traits::row::*; pub use traits::inv::*; pub use traits::rlmul::*; pub use traits::rotation::*; pub use traits::transformation::*; pub use traits::translation::*; pub use traits::transpose::*; +pub use traits::homogeneous::*; mod mat_macros; diff --git a/src/mat_spec.rs b/src/mat_spec.rs index f3a96818..4becb24a 100644 --- a/src/mat_spec.rs +++ b/src/mat_spec.rs @@ -1,8 +1,6 @@ use std::num::{Zero, One}; use vec::Vec3; -use mat::{Mat1, Mat2, Mat3}; -use traits::inv::Inv; -use traits::row::Row; +use mat::{Mat1, Mat2, Mat3, Inv, Row}; // some specializations: impl diff --git a/src/vec.rs b/src/vec.rs index a6bde482..74b55e38 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -4,17 +4,23 @@ use std::rand::Rng; use std::vec::{VecIterator, VecMutIterator}; use std::iterator::{Iterator, FromIterator}; use std::cmp::ApproxEq; -use traits::basis::Basis; -use traits::dim::Dim; -use traits::translation::{Translation, Translate}; -use traits::transformation::Transform; -use traits::rotation::Rotate; -use traits::homogeneous::{FromHomogeneous, ToHomogeneous}; -use traits::indexable::Indexable; -use traits::scalar_op::{ScalarAdd, ScalarSub}; -use traits::iterable::{Iterable, IterableMut}; -use traits::vec_cast::VecCast; -use traits::vector::{Vec, AlgebraicVec}; + +pub use traits::translation::*; +pub use traits::transformation::*; +pub use traits::rotation::*; +pub use traits::homogeneous::*; +pub use traits::vec_cast::*; +pub use traits::vector::*; +pub use traits::basis::*; +pub use traits::dim::*; +pub use traits::basis::*; +pub use traits::indexable::*; +pub use traits::iterable::*; +pub use traits::sample::*; +pub use traits::scalar_op::*; +pub use traits::cross::*; +pub use traits::sample::*; +pub use traits::row::*; mod vec_macros; diff --git a/src/vec_spec.rs b/src/vec_spec.rs index 043d2c3a..466e2c8e 100644 --- a/src/vec_spec.rs +++ b/src/vec_spec.rs @@ -1,11 +1,5 @@ use std::num::{Zero, One}; -use traits::basis::Basis; -use traits::cross::{Cross, CrossMatrix}; -use traits::sample::UniformSphereSample; -use traits::vec_cast::VecCast; -use traits::vector::{AlgebraicVec}; -use traits::row::Row; -use vec::{Vec1, Vec2, Vec3}; +use vec::{Vec1, Vec2, Vec3, Row, AlgebraicVec, VecCast, UniformSphereSample, Cross, CrossMatrix, Basis}; use mat::Mat3; impl + Sub> Cross> for Vec2 {