From d43629e2b92f1b3c7ba7fb08051377012c3f3ada Mon Sep 17 00:00:00 2001 From: maikklein Date: Sun, 30 Jun 2013 18:28:39 +0200 Subject: [PATCH] fixes += operator etc --- src/vec_macros.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vec_macros.rs b/src/vec_macros.rs index 9b5abeb..3402502 100644 --- a/src/vec_macros.rs +++ b/src/vec_macros.rs @@ -62,17 +62,17 @@ macro_rules! impl_vec_numeric( #[inline] pub fn rem_v(&self, other: &$Vec) -> $Vec { $Vec::from_slice(self.zip(other, |&a, &b| a % b)) } #[inline] pub fn neg_self(&mut self) { self.map_mut(|x| *x = -*x) } - #[inline] pub fn add_self_t(&mut self, value: T) { self.map_mut(|x| *x += value.clone()) } - #[inline] pub fn sub_self_t(&mut self, value: T) { self.map_mut(|x| *x -= value.clone()) } - #[inline] pub fn mul_self_t(&mut self, value: T) { self.map_mut(|x| *x *= value.clone()) } - #[inline] pub fn div_self_t(&mut self, value: T) { self.map_mut(|x| *x /= value.clone()) } - #[inline] pub fn rem_self_t(&mut self, value: T) { self.map_mut(|x| *x %= value.clone()) } + #[inline] pub fn add_self_t(&mut self, value: T) { self.map_mut(|x| *x = *x + value.clone()) } + #[inline] pub fn sub_self_t(&mut self, value: T) { self.map_mut(|x| *x = *x - value.clone()) } + #[inline] pub fn mul_self_t(&mut self, value: T) { self.map_mut(|x| *x = *x * value.clone()) } + #[inline] pub fn div_self_t(&mut self, value: T) { self.map_mut(|x| *x = *x / value.clone()) } + #[inline] pub fn rem_self_t(&mut self, value: T) { self.map_mut(|x| *x = *x % value.clone()) } - #[inline] pub fn add_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a += b) } - #[inline] pub fn sub_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a -= b) } - #[inline] pub fn mul_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a *= b) } - #[inline] pub fn div_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a /= b) } - #[inline] pub fn rem_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a %= b) } + #[inline] pub fn add_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a =*a + b) } + #[inline] pub fn sub_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a =*a - b) } + #[inline] pub fn mul_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a =*a * b) } + #[inline] pub fn div_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a =*a / b) } + #[inline] pub fn rem_self_v(&mut self, other: &$Vec) { self.zip_mut(other, |a, &b| *a =*a % b) } #[inline] pub fn dot(&self, other: &$Vec) -> T { vec_dot!($Vec) } }