From c38b4b601da4ae3c9c13b05fc5161035d850551e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 16 Apr 2019 14:30:46 -0700 Subject: [PATCH] cargo fmt --- src/lib.rs | 34 ++++++++-------------------------- src/sign.rs | 6 +----- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5a25bab..172e714 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,13 +90,12 @@ pub trait NumOps: { } -impl NumOps for T -where +impl NumOps for T where T: Add + Sub + Mul + Div - + Rem, + + Rem { } @@ -105,22 +104,14 @@ where /// /// This is automatically implemented for types which implement the operators. pub trait NumRef: Num + for<'r> NumOps<&'r Self> {} -impl NumRef for T -where - T: Num + for<'r> NumOps<&'r T>, -{ -} +impl NumRef for T where T: Num + for<'r> NumOps<&'r T> {} /// The trait for references which implement numeric operations, taking the /// second operand either by value or by reference. /// /// This is automatically implemented for types which implement the operators. pub trait RefNum: NumOps + for<'r> NumOps<&'r Base, Base> {} -impl RefNum for T -where - T: NumOps + for<'r> NumOps<&'r Base, Base>, -{ -} +impl RefNum for T where T: NumOps + for<'r> NumOps<&'r Base, Base> {} /// The trait for types implementing numeric assignment operators (like `+=`). /// @@ -130,9 +121,8 @@ pub trait NumAssignOps: { } -impl NumAssignOps for T -where - T: AddAssign + SubAssign + MulAssign + DivAssign + RemAssign, +impl NumAssignOps for T where + T: AddAssign + SubAssign + MulAssign + DivAssign + RemAssign { } @@ -140,22 +130,14 @@ where /// /// This is automatically implemented for types which implement the operators. pub trait NumAssign: Num + NumAssignOps {} -impl NumAssign for T -where - T: Num + NumAssignOps, -{ -} +impl NumAssign for T where T: Num + NumAssignOps {} /// The trait for `NumAssign` types which also implement assignment operations /// taking the second operand by reference. /// /// This is automatically implemented for types which implement the operators. pub trait NumAssignRef: NumAssign + for<'r> NumAssignOps<&'r Self> {} -impl NumAssignRef for T -where - T: NumAssign + for<'r> NumAssignOps<&'r T>, -{ -} +impl NumAssignRef for T where T: NumAssign + for<'r> NumAssignOps<&'r T> {} macro_rules! int_trait_impl { ($name:ident for $($t:ty)*) => ($( diff --git a/src/sign.rs b/src/sign.rs index cb1d9fb..26d44c5 100644 --- a/src/sign.rs +++ b/src/sign.rs @@ -206,11 +206,7 @@ empty_trait_impl!(Unsigned for usize u8 u16 u32 u64); #[cfg(has_i128)] empty_trait_impl!(Unsigned for u128); -impl Unsigned for Wrapping -where - Wrapping: Num, -{ -} +impl Unsigned for Wrapping where Wrapping: Num {} #[test] fn unsigned_wrapping_is_unsigned() {