drop redundant impl_scalar_ops_default

This commit is contained in:
Norbert Nemec 2019-09-01 16:09:34 +02:00
parent 1c7c889921
commit 40d0afd036

View file

@ -596,14 +596,14 @@ macro_rules! impl_vector_default {
impl_scalar_ops!($VectorN<usize> { $($field),+ });
impl_scalar_ops!($VectorN<u8> { $($field),+ });
impl_scalar_ops!($VectorN<u16> { $($field),+ });
impl_scalar_ops_default!($VectorN<u32> { $($field),+ });
impl_scalar_ops!($VectorN<u32> { $($field),+ });
impl_scalar_ops!($VectorN<u64> { $($field),+ });
impl_scalar_ops!($VectorN<isize> { $($field),+ });
impl_scalar_ops!($VectorN<i8> { $($field),+ });
impl_scalar_ops!($VectorN<i16> { $($field),+ });
impl_scalar_ops_default!($VectorN<i32> { $($field),+ });
impl_scalar_ops!($VectorN<i32> { $($field),+ });
impl_scalar_ops!($VectorN<i64> { $($field),+ });
impl_scalar_ops_default!($VectorN<f32> { $($field),+ });
impl_scalar_ops!($VectorN<f32> { $($field),+ });
impl_scalar_ops!($VectorN<f64> { $($field),+ });
impl_index_operators!($VectorN<S>, $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);