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 { - 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) }