summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-12-17 11:36:51 +0100
committerGitHub <noreply@github.com>2020-12-17 11:36:51 +0100
commit93f1c67e91939e7f0f933194cb2168ca76c19068 (patch)
tree76209c4298b6445933c57aa17fa01bcbbb12010b
parent53af11651b448b34f21f63fb49e74f7186aed30e (diff)
parent777ca999a999a601b1b4eb3b6147fa77d2ea902c (diff)
downloadrust-93f1c67e91939e7f0f933194cb2168ca76c19068.tar.gz
Rollup merge of #80035 - ChayimFriedman2:patch-1, r=nagisa
Optimization for bool's PartialOrd impl Fix #80034.
-rw-r--r--library/core/src/cmp.rs2
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))
}
}