about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/cmp.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index dc550fc2173..3344d7ea5d7 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -471,9 +471,7 @@ mod impls {
             impl PartialOrd for $t {
                 #[inline]
                 fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
-                    if *self == *other { Some(Equal) }
-                    else if *self < *other { Some(Less) }
-                    else { Some(Greater) }
+                    Some(self.cmp(other))
                 }
                 #[inline]
                 fn lt(&self, other: &$t) -> bool { (*self) < (*other) }