diff --git a/src/adaptors/transform.rs b/src/adaptors/transform.rs index 3aa2d3c8..5298599d 100644 --- a/src/adaptors/transform.rs +++ b/src/adaptors/transform.rs @@ -101,11 +101,11 @@ impl, V, _0> Translate for Transform { self.submat.inv_translate(v) } } -impl, Res: Translation> -Translatable> for Transform +impl + Translation> +Translatable> for Transform { #[inline] - fn translated(&self, t: &V) -> Transform + fn translated(&self, t: &V) -> Transform { Transform::new(copy self.submat, self.subtrans.translated(t)) } } @@ -146,7 +146,7 @@ impl, V, _0> Rotate for Transform } impl + One, - Res: Rotation + RMul, + Res: Rotation + RMul + One, V, AV> Rotatable> for Transform @@ -189,7 +189,7 @@ transformation::Transform for Transform // FIXME: constraints are too restrictive. // Should be: Transformable ... -impl + Mul, V: Add> +impl + Mul + Inv, V: Add + Neg> Transformable, Transform> for Transform { fn transformed(&self, t: &Transform) -> Transform diff --git a/src/dvec.rs b/src/dvec.rs index 00b38688..8673cce7 100644 --- a/src/dvec.rs +++ b/src/dvec.rs @@ -13,7 +13,7 @@ use traits::norm::Norm; use traits::translation::{Translation, Translatable}; use traits::scalar_op::{ScalarMul, ScalarDiv, ScalarAdd, ScalarSub}; -#[deriving(Eq, Ord, ToStr, Clone)] +#[deriving(Eq, Ord, ToStr)] pub struct DVec { at: ~[N] @@ -53,7 +53,7 @@ impl> FromIterator for DVec } // FIXME: is Clone needed? -impl> DVec +impl> DVec { pub fn canonical_basis_with_dim(dim: uint) -> ~[DVec] { @@ -87,7 +87,7 @@ impl> DVec if res.len() == dim - 1 { break; } - let mut elt = basis_element.clone(); + let mut elt = copy basis_element; elt = elt - self.scalar_mul(&basis_element.dot(self)); @@ -223,11 +223,11 @@ ScalarSub for DVec } } -impl + Neg> Translation> for DVec +impl + Neg> Translation> for DVec { #[inline] fn translation(&self) -> DVec - { self.clone() } + { copy *self } #[inline] fn inv_translation(&self) -> DVec @@ -238,14 +238,14 @@ impl + Neg> Translation> for DVec { *self = *self + *t; } } -impl + Copy> Translatable, DVec> for DVec +impl + Neg + Copy> Translatable, DVec> for DVec { #[inline] fn translated(&self, t: &DVec) -> DVec { self + *t } } -impl +impl Norm for DVec { #[inline] @@ -259,7 +259,7 @@ Norm for DVec #[inline] fn normalized(&self) -> DVec { - let mut res : DVec = self.clone(); + let mut res : DVec = copy *self; res.normalize(); diff --git a/src/vec_impl.rs b/src/vec_impl.rs index 37f3902a..7902cacd 100644 --- a/src/vec_impl.rs +++ b/src/vec_impl.rs @@ -309,7 +309,7 @@ macro_rules! translation_impl( macro_rules! translatable_impl( ($t: ident) => ( - impl + Copy> Translatable<$t, $t> for $t + impl + Neg + Copy> Translatable<$t, $t> for $t { #[inline] fn translated(&self, t: &$t) -> $t