diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 1c1ca49..9ed0f1a 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -62,47 +62,47 @@ impl std::ops::Neg for Fixed{ macro_rules! impl_operator { ( $struct: ident, $trait: ident, $method: ident, $output: ty ) => { - impl core::ops::$trait for $struct{ - type Output = $output; + impl core::ops::$trait for $struct{ + type Output = $output; - fn $method(self, other: Self) -> Self::Output { - Self { - bits:self.bits.$method(other.bits), - frac:PhantomData, - } - } - } - impl core::ops::$trait for $struct - where - BInt:::From, - { - type Output = $output; + fn $method(self, other: Self) -> Self::Output { + Self { + bits:self.bits.$method(other.bits), + frac:PhantomData, + } + } + } + impl core::ops::$trait for $struct + where + BInt:::From, + { + type Output = $output; - fn $method(self, other: U) -> Self::Output { - Self { - bits:self.bits.$method(BInt::::from(other)< Self::Output { + Self { + bits:self.bits.$method(BInt::::from(other)< { - impl core::ops::$trait for $struct{ - fn $method(&mut self, other: Self) { - self.bits.$method(other.bits); - } - } - impl core::ops::$trait for $struct - where - BInt:::From, - { - fn $method(&mut self, other: U) { - self.bits.$method(BInt::::from(other)< { + impl core::ops::$trait for $struct{ + fn $method(&mut self, other: Self) { + self.bits.$method(other.bits); + } + } + impl core::ops::$trait for $struct + where + BInt:::From, + { + fn $method(&mut self, other: U) { + self.bits.$method(BInt::::from(other)< { - impl core::ops::$trait for $struct{ - type Output = $output; + impl core::ops::$trait for $struct{ + type Output = $output; - fn $method(self, other: u32) -> Self::Output { - Self { - bits:self.bits.$method(other), - frac:PhantomData, - } - } - } - }; + fn $method(self, other: u32) -> Self::Output { + Self { + bits:self.bits.$method(other), + frac:PhantomData, + } + } + } + }; } macro_rules! impl_shift_assign_operator { - ( $struct: ident, $trait: ident, $method: ident ) => { - impl core::ops::$trait for $struct{ - fn $method(&mut self, other: u32) { - self.bits.$method(other); - } - } - }; + ( $struct: ident, $trait: ident, $method: ident ) => { + impl core::ops::$trait for $struct{ + fn $method(&mut self, other: u32) { + self.bits.$method(other); + } + } + }; } impl_shift_assign_operator!( Fixed, ShlAssign, shl_assign ); impl_shift_operator!( Fixed, Shl, shl, Self );