From 40d0afd036ce00bd4ed2492d84e910a03309753c Mon Sep 17 00:00:00 2001 From: Norbert Nemec Date: Sun, 1 Sep 2019 16:09:34 +0200 Subject: [PATCH] drop redundant impl_scalar_ops_default --- src/vector.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/vector.rs b/src/vector.rs index e456e78..3ce76c2 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -596,14 +596,14 @@ macro_rules! impl_vector_default { impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); - impl_scalar_ops_default!($VectorN { $($field),+ }); + impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); - impl_scalar_ops_default!($VectorN { $($field),+ }); + impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); - impl_scalar_ops_default!($VectorN { $($field),+ }); + impl_scalar_ops!($VectorN { $($field),+ }); impl_scalar_ops!($VectorN { $($field),+ }); impl_index_operators!($VectorN, $n, S, usize); @@ -628,21 +628,6 @@ macro_rules! impl_scalar_ops { }; } -#[cfg(feature = "simd")] -macro_rules! impl_scalar_ops_default { - ($VectorN:ident<$S:ident> { $($field:ident),+ }) => { - impl_operator!(Mul<$VectorN<$S>> for $S { - fn mul(scalar, vector) -> $VectorN<$S> { $VectorN::new($(scalar * vector.$field),+) } - }); - impl_operator!(Div<$VectorN<$S>> for $S { - fn div(scalar, vector) -> $VectorN<$S> { $VectorN::new($(scalar / vector.$field),+) } - }); - impl_operator!(Rem<$VectorN<$S>> for $S { - fn rem(scalar, vector) -> $VectorN<$S> { $VectorN::new($(scalar % vector.$field),+) } - }); - }; -} - impl_vector!(Vector1 { x }, 1, vec1); impl_vector!(Vector2 { x, y }, 2, vec2); impl_vector!(Vector3 { x, y, z }, 3, vec3);