diff --git a/src/integer.rs b/src/integer.rs index 023ef41..883c01c 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -13,9 +13,7 @@ use {Num, Signed}; pub trait Integer - : Sized - + Num - + PartialOrd + Ord + Eq + : Sized + Num + Ord { /// Floored integer division. /// diff --git a/src/iter.rs b/src/iter.rs index 917e614..33bc267 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -96,7 +96,7 @@ impl Iterator for Range /// `Integer` is required to ensure the range will be the same regardless of /// the direction it is consumed. impl DoubleEndedIterator for Range - where A: Integer + PartialOrd + Clone + ToPrimitive + where A: Integer + Clone + ToPrimitive { #[inline] fn next_back(&mut self) -> Option { @@ -161,7 +161,7 @@ impl Iterator for RangeInclusive } impl DoubleEndedIterator for RangeInclusive - where A: Sub + Integer + PartialOrd + Clone + ToPrimitive + where A: Sub + Integer + Clone + ToPrimitive { #[inline] fn next_back(&mut self) -> Option { diff --git a/src/rational.rs b/src/rational.rs index fd7305e..d7b24fd 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -41,7 +41,7 @@ pub type Rational64 = Ratio; /// Alias for arbitrary precision rationals. pub type BigRational = Ratio; -impl Ratio { +impl Ratio { /// Creates a ratio representing the integer `t`. #[inline] pub fn from_integer(t: T) -> Ratio { @@ -187,7 +187,7 @@ impl Ratio { } } -impl Ratio { +impl Ratio { /// Raises the ratio to the power of an exponent #[inline] pub fn pow(&self, expon: i32) -> Ratio { @@ -254,7 +254,7 @@ cmp_impl!(impl Ord, cmp -> cmp::Ordering); macro_rules! forward_val_val_binop { (impl $imp:ident, $method:ident) => { - impl $imp> for Ratio { + impl $imp> for Ratio { type Output = Ratio; #[inline] @@ -268,7 +268,7 @@ macro_rules! forward_val_val_binop { macro_rules! forward_ref_val_binop { (impl $imp:ident, $method:ident) => { impl<'a, T> $imp> for &'a Ratio where - T: Clone + Integer + PartialOrd + T: Clone + Integer { type Output = Ratio; @@ -283,7 +283,7 @@ macro_rules! forward_ref_val_binop { macro_rules! forward_val_ref_binop { (impl $imp:ident, $method:ident) => { impl<'a, T> $imp<&'a Ratio> for Ratio where - T: Clone + Integer + PartialOrd + T: Clone + Integer { type Output = Ratio; @@ -307,7 +307,7 @@ macro_rules! forward_all_binop { forward_all_binop!(impl Mul, mul); // a/b * c/d = (a*c)/(b*d) impl<'a, 'b, T> Mul<&'b Ratio> for &'a Ratio - where T: Clone + Integer + PartialOrd + where T: Clone + Integer { type Output = Ratio; @@ -320,7 +320,7 @@ impl<'a, 'b, T> Mul<&'b Ratio> for &'a Ratio forward_all_binop!(impl Div, div); // (a/b) / (c/d) = (a*d)/(b*c) impl<'a, 'b, T> Div<&'b Ratio> for &'a Ratio - where T: Clone + Integer + PartialOrd + where T: Clone + Integer { type Output = Ratio; @@ -334,7 +334,7 @@ impl<'a, 'b, T> Div<&'b Ratio> for &'a Ratio macro_rules! arith_impl { (impl $imp:ident, $method:ident) => { forward_all_binop!(impl $imp, $method); - impl<'a, 'b, T: Clone + Integer + PartialOrd> + impl<'a, 'b, T: Clone + Integer> $imp<&'b Ratio> for &'a Ratio { type Output = Ratio; #[inline] @@ -356,7 +356,7 @@ arith_impl!(impl Sub, sub); arith_impl!(impl Rem, rem); impl Neg for Ratio - where T: Clone + Integer + PartialOrd + Neg + where T: Clone + Integer + Neg { type Output = Ratio; @@ -365,7 +365,7 @@ impl Neg for Ratio } impl<'a, T> Neg for &'a Ratio - where T: Clone + Integer + PartialOrd + Neg + where T: Clone + Integer + Neg { type Output = Ratio; @@ -376,7 +376,7 @@ impl<'a, T> Neg for &'a Ratio } /* Constants */ -impl +impl Zero for Ratio { #[inline] fn zero() -> Ratio { @@ -389,7 +389,7 @@ impl } } -impl +impl One for Ratio { #[inline] fn one() -> Ratio { @@ -397,7 +397,7 @@ impl } } -impl Num for Ratio { +impl Num for Ratio { type FromStrRadixErr = ParseRatioError; /// Parses `numer/denom` where the numbers are in base `radix`. @@ -423,7 +423,7 @@ impl Num for Ratio { } } -impl Signed for Ratio { +impl Signed for Ratio { #[inline] fn abs(&self) -> Ratio { if self.is_negative() { -self.clone() } else { self.clone() } @@ -466,7 +466,7 @@ impl fmt::Display for Ratio where } } -impl FromStr for Ratio { +impl FromStr for Ratio { type Err = ParseRatioError; /// Parses `numer/denom` or just `numer`.