diff --git a/src/rational.rs b/src/rational.rs index b3dc3ac..2f1100a 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -52,28 +52,21 @@ impl Frac { } } -macro_rules! impl_mul { - ($( $Type: ty ),* ) => { - $( - impl Mul for Frac<$Type> { - type Output = Self; +impl> Mul for Frac { + type Output = Self; - fn mul(self, rhs: Self) -> Self { - let numer = self.numer * rhs.numer; - let denom = self.denom * rhs.denom; + fn mul(self, rhs: Self) -> Self { + let numer = self.numer * rhs.numer; + let denom = self.denom * rhs.denom; - // Figure out the sign - if self.sign != rhs.sign { - Self::new_neg(numer, denom) - } else { - Self::new(numer, denom) - } - } - } - )* - }; + // Figure out the sign + if self.sign != rhs.sign { + Self::new_neg(numer, denom) + } else { + Self::new(numer, denom) + } + } } -impl_mul!(u8, u16, u32, u64, usize, u128); impl Neg for Frac { type Output = Self;