diff --git a/src/display.rs b/src/display.rs index 4929d91..ad52969 100644 --- a/src/display.rs +++ b/src/display.rs @@ -177,27 +177,27 @@ macro_rules! impl_fmt { fmt_dec(*self, f) } } - impl Debug for $Fixed { + impl Debug for $Fixed { fn fmt(&self, f: &mut Formatter) -> FmtResult { fmt_dec(*self, f) } } - impl Binary for $Fixed { + impl Binary for $Fixed { fn fmt(&self, f: &mut Formatter) -> FmtResult { fmt_radix2(*self, &Bin, f) } } - impl Octal for $Fixed { + impl Octal for $Fixed { fn fmt(&self, f: &mut Formatter) -> FmtResult { fmt_radix2(*self, &Oct, f) } } - impl LowerHex for $Fixed { + impl LowerHex for $Fixed { fn fmt(&self, f: &mut Formatter) -> FmtResult { fmt_radix2(*self, &LowHex, f) } } - impl UpperHex for $Fixed { + impl UpperHex for $Fixed { fn fmt(&self, f: &mut Formatter) -> FmtResult { fmt_radix2(*self, &UpHex, f) } @@ -441,12 +441,7 @@ mod tests { impl PartialEq for Buf { fn eq(&self, rhs: &Buf) -> bool { - for (&a, &b) in self.0.iter().zip(rhs.0.iter()) { - if a != b { - return false; - } - } - true + self.0.iter().zip(rhs.0.iter()).all(|(a, b)| a == b) } } @@ -467,13 +462,13 @@ mod tests { } macro_rules! assert_eq_fmt { - (($f1:expr, $($arg1:tt)*), ($f2:expr, $($arg2:tt)*)) => {({ + (($f1:expr, $($arg1:tt)*), ($f2:expr, $($arg2:tt)*)) => {{ let mut buf1 = Buf::new(); write!(buf1.target(), $f1, $($arg1)*).unwrap(); let mut buf2 = Buf::new(); write!(buf2.target(), $f2, $($arg2)*).unwrap(); assert_eq!(buf1, buf2); - })} + }}; } #[test] diff --git a/src/lib.rs b/src/lib.rs index 26d7dfe..cf3a7ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -330,7 +330,7 @@ macro_rules! fixed { #[inline] fn hash(&self, state: &mut H) where - H: Hasher + H: Hasher, { self.to_bits().hash(state); }