diff --git a/fixed_wide/src/wide.rs b/fixed_wide/src/wide.rs index 09cb448..7944395 100644 --- a/fixed_wide/src/wide.rs +++ b/fixed_wide/src/wide.rs @@ -29,16 +29,13 @@ impl PartialEq for Fixed{ impl Eq for Fixed{} macro_rules! impl_operator { - ( $struct: ident, $trait: ident, $method: ident, $output: ty ) => { - impl core::ops::$trait for $struct - where - $struct:From - { + ( $struct: ident, $trait: ident, $method: ident, $output: ty ) => { + impl core::ops::$trait<$struct> for $struct{ type Output = $output; - fn $method(self, other: T) -> Self::Output { + fn $method(self, other: Self) -> Self::Output { Self { - bits:self.bits.$method($struct::::from(other).bits), + bits:self.bits.$method(other.bits), frac:PhantomData, } } @@ -47,12 +44,9 @@ macro_rules! impl_operator { } macro_rules! impl_assign_operator { ( $struct: ident, $trait: ident, $method: ident ) => { - impl core::ops::$trait for $struct - where - $struct:From - { - fn $method(&mut self, other: T) { - self.bits.$method($struct::::from(other).bits); + impl core::ops::$trait<$struct> for $struct{ + fn $method(&mut self, other: Self) { + self.bits.$method(other.bits); } } };