From 7ef933aefbf3ddba9a43e0bbd850f6bafb243968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Fri, 25 Apr 2014 20:28:05 +0200 Subject: [PATCH] Update to the last Rust. Version of rustc: 0.11-pre (eea4909 2014-04-24 23:41:15 -0700) Vector do not implement `Rand` anymore. --- src/structs/rot.rs | 2 +- src/structs/vec.rs | 6 ------ src/structs/vec_macros.rs | 26 -------------------------- src/traits/structure.rs | 4 ++-- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/src/structs/rot.rs b/src/structs/rot.rs index ace1501f..4bdcb84d 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -35,7 +35,7 @@ impl Rotation> for Rot2 { #[inline] fn rotation(&self) -> Vec1 { - Vec1::new((-self.submat.m12).atan2(&self.submat.m11)) + Vec1::new((-self.submat.m12).atan2(self.submat.m11.clone())) } #[inline] diff --git a/src/structs/vec.rs b/src/structs/vec.rs index dfe960fc..bcb1da6b 100644 --- a/src/structs/vec.rs +++ b/src/structs/vec.rs @@ -103,7 +103,6 @@ scalar_sub_impl!(Vec1, int, Vec1SubRhs, x) translation_impl!(Vec1) norm_impl!(Vec1, x) approx_eq_impl!(Vec1, x) -round_impl!(Vec1, x) one_impl!(Vec1, x) from_iterator_impl!(Vec1, iterator) bounded_impl!(Vec1, x) @@ -201,7 +200,6 @@ scalar_sub_impl!(Vec2, int, Vec2SubRhs, x, y) translation_impl!(Vec2) norm_impl!(Vec2, x, y) approx_eq_impl!(Vec2, x, y) -round_impl!(Vec2, x, y) one_impl!(Vec2, x, y) from_iterator_impl!(Vec2, iterator, iterator) bounded_impl!(Vec2, x, y) @@ -304,7 +302,6 @@ scalar_sub_impl!(Vec3, int, Vec3SubRhs, x, y, z) translation_impl!(Vec3) norm_impl!(Vec3, x, y ,z) approx_eq_impl!(Vec3, x, y, z) -round_impl!(Vec3, x, y, z) one_impl!(Vec3, x, y, z) from_iterator_impl!(Vec3, iterator, iterator, iterator) bounded_impl!(Vec3, x, y, z) @@ -407,7 +404,6 @@ scalar_sub_impl!(Vec4, int, Vec4SubRhs, x, y, z, w) translation_impl!(Vec4) norm_impl!(Vec4, x, y, z, w) approx_eq_impl!(Vec4, x, y, z, w) -round_impl!(Vec4, x, y, z, w) one_impl!(Vec4, x, y, z, w) from_iterator_impl!(Vec4, iterator, iterator, iterator, iterator) bounded_impl!(Vec4, x, y, z, w) @@ -511,7 +507,6 @@ scalar_sub_impl!(Vec5, int, Vec5SubRhs, x, y, z, w, a) translation_impl!(Vec5) norm_impl!(Vec5, x, y, z, w, a) approx_eq_impl!(Vec5, x, y, z, w, a) -round_impl!(Vec5, x, y, z, w, a) one_impl!(Vec5, x, y, z, w, a) from_iterator_impl!(Vec5, iterator, iterator, iterator, iterator, iterator) bounded_impl!(Vec5, x, y, z, w, a) @@ -617,7 +612,6 @@ scalar_sub_impl!(Vec6, int, Vec6SubRhs, x, y, z, w, a, b) translation_impl!(Vec6) norm_impl!(Vec6, x, y, z, w, a, b) approx_eq_impl!(Vec6, x, y, z, w, a, b) -round_impl!(Vec6, x, y, z, w, a, b) one_impl!(Vec6, x, y, z, w, a, b) from_iterator_impl!(Vec6, iterator, iterator, iterator, iterator, iterator, iterator) bounded_impl!(Vec6, x, y, z, w, a, b) diff --git a/src/structs/vec_macros.rs b/src/structs/vec_macros.rs index fd492d63..0eeafb93 100644 --- a/src/structs/vec_macros.rs +++ b/src/structs/vec_macros.rs @@ -493,32 +493,6 @@ macro_rules! norm_impl( ) ) -macro_rules! round_impl( - ($t: ident, $comp0: ident $(,$compN: ident)*) => ( - impl Round for $t { - fn floor(&self) -> $t { - $t::new(self.$comp0.floor() $(, self.$compN.floor())*) - } - - fn ceil(&self) -> $t { - $t::new(self.$comp0.ceil() $(, self.$compN.ceil())*) - } - - fn round(&self) -> $t { - $t::new(self.$comp0.round() $(, self.$compN.round())*) - } - - fn trunc(&self) -> $t { - $t::new(self.$comp0.trunc() $(, self.$compN.trunc())*) - } - - fn fract(&self) -> $t { - $t::new(self.$comp0.fract() $(, self.$compN.fract())*) - } - } - ) -) - macro_rules! approx_eq_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> ApproxEq for $t { diff --git a/src/traits/structure.rs b/src/traits/structure.rs index 0b3784b3..db0f1be9 100644 --- a/src/traits/structure.rs +++ b/src/traits/structure.rs @@ -39,7 +39,7 @@ pub trait VecExt: AnyVec + Indexable + Iterable + /// Trait grouping uncommon, low-level and borderline (from the mathematical point of view) /// operations on vectors. -pub trait FloatVecExt: FloatVec + VecExt + Basis + Round { } +pub trait FloatVecExt: FloatVec + VecExt + Basis { } impl + Add + Neg + Zero + Eq + Mul + Div + Dot> AnyVec for V { } @@ -51,7 +51,7 @@ impl + ScalarSub + Bounded> VecExt for V { } -impl + VecExt + Basis + Round> FloatVecExt for V { } +impl + VecExt + Basis> FloatVecExt for V { } // FIXME: return an iterator instead /// Traits of objects which can form a basis (typically vectors).