From Macro to tortured Generic

This commit is contained in:
Timothy Warren 2020-02-14 12:30:09 -05:00
parent 16741c8c4d
commit d20cb06c87
1 changed files with 12 additions and 19 deletions

View File

@ -52,10 +52,7 @@ impl<T: Unsigned> Frac<T> {
}
}
macro_rules! impl_mul {
($( $Type: ty ),* ) => {
$(
impl Mul for Frac<$Type> {
impl<T: Unsigned + Mul<Output = T>> Mul for Frac<T> {
type Output = Self;
fn mul(self, rhs: Self) -> Self {
@ -70,10 +67,6 @@ macro_rules! impl_mul {
}
}
}
)*
};
}
impl_mul!(u8, u16, u32, u64, usize, u128);
impl<T: Unsigned> Neg for Frac<T> {
type Output = Self;