]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/cmp.rs
cmp: Implement all PartialOrd methods for Reverse
[rust.git] / src / libcore / cmp.rs
index dc2398b22acec67e6dbd98f1c94a9698a266c4ef..74ded948b18e74a8dad5126880f24bea19585372 100644 (file)
@@ -347,6 +347,15 @@ impl<T: PartialOrd> PartialOrd for Reverse<T> {
     fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering> {
         other.0.partial_cmp(&self.0)
     }
+
+    #[inline]
+    fn lt(&self, other: &Self) -> bool { other.0 < self.0 }
+    #[inline]
+    fn le(&self, other: &Self) -> bool { other.0 <= self.0 }
+    #[inline]
+    fn ge(&self, other: &Self) -> bool { other.0 >= self.0 }
+    #[inline]
+    fn gt(&self, other: &Self) -> bool { other.0 > self.0 }
 }
 
 #[unstable(feature = "reverse_cmp_key", issue = "40893")]