Parcourir la source

Removed useless trait bounds

Yoan Lecoq il y a 8 ans
Parent
commit
356a4ba5b5
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 1 1
      traits/src/identities.rs
  2. 2 2
      traits/src/lib.rs

+ 1 - 1
traits/src/identities.rs

@@ -51,7 +51,7 @@ zero_impl!(i64,   0i64);
 zero_impl!(f32, 0.0f32);
 zero_impl!(f64, 0.0f64);
 
-impl<T: Zero + PartialEq> Zero for Wrapping<T> where Wrapping<T>: Add<Output=Wrapping<T>> {
+impl<T: Zero> Zero for Wrapping<T> where Wrapping<T>: Add<Output=Wrapping<T>> {
     fn is_zero(&self) -> bool {
         self.0.is_zero()
     }

+ 2 - 2
traits/src/lib.rs

@@ -76,8 +76,8 @@ macro_rules! int_trait_impl {
 int_trait_impl!(Num for usize u8 u16 u32 u64 isize i8 i16 i32 i64);
 
 impl<T: Num> Num for Wrapping<T>
-    where Wrapping<T>: Zero + One
-        + Add<Output = Wrapping<T>> + Sub<Output = Wrapping<T>>
+    where Wrapping<T>:
+          Add<Output = Wrapping<T>> + Sub<Output = Wrapping<T>>
         + Mul<Output = Wrapping<T>> + Div<Output = Wrapping<T>> + Rem<Output = Wrapping<T>>
 {
     type FromStrRadixErr = T::FromStrRadixErr;