diff options
author | Chayim Refael Friedman <chayimfr@gmail.com> | 2020-12-14 21:01:19 +0200 |
---|---|---|
committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2020-12-14 23:32:52 +0200 |
commit | 777ca999a999a601b1b4eb3b6147fa77d2ea902c (patch) | |
tree | 1d9e6e3e888098b254b21223a4001f7238735e36 | |
parent | 1f7762b4fcf47d36bf0718d5265a5c6ca7f33687 (diff) | |
download | rust-777ca999a999a601b1b4eb3b6147fa77d2ea902c.tar.gz |
Optimization for bool's PartialOrd impl
-rw-r--r-- | library/core/src/cmp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index f752472c3ba..0c459a820c6 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -1236,7 +1236,7 @@ mod impls { impl PartialOrd for bool { #[inline] fn partial_cmp(&self, other: &bool) -> Option<Ordering> { - (*self as u8).partial_cmp(&(*other as u8)) + Some(self.cmp(other)) } } |