diff --git a/ratio_ops/src/ratio.rs b/ratio_ops/src/ratio.rs index b41dc74..a525b71 100644 --- a/ratio_ops/src/ratio.rs +++ b/ratio_ops/src/ratio.rs @@ -251,15 +251,18 @@ impl_ratio_assign_operator!(RemAssign,rem_assign); // Only implement PartialEq // Rust's operators aren't actually that good -impl PartialEq for Ratio +impl PartialEq> for Ratio where - Num:Copy, - Den:Copy, - Num:core::ops::Mul, - T:PartialEq, + LhsNum:Copy, + LhsDen:Copy, + RhsNum:Copy, + RhsDen:Copy, + LhsNum:core::ops::Mul, + RhsNum:core::ops::Mul, + T:PartialEq, { #[inline] - fn eq(&self,&other:&Self)->bool{ + fn eq(&self,other:&Ratio)->bool{ (self.num*other.den).eq(&(other.num*self.den)) } } @@ -268,15 +271,18 @@ impl Eq for Ratio Ratio:PartialEq, {} -impl PartialOrd for Ratio +impl PartialOrd> for Ratio where - Num:Copy, - Den:Copy, - Num:core::ops::Mul, - T:PartialOrd, + LhsNum:Copy, + LhsDen:Copy, + RhsNum:Copy, + RhsDen:Copy, + LhsNum:core::ops::Mul, + RhsNum:core::ops::Mul, + T:PartialOrd, { #[inline] - fn partial_cmp(&self,&other:&Self)->Option{ + fn partial_cmp(&self,other:&Ratio)->Option{ (self.num*other.den).partial_cmp(&(other.num*self.den)) } }