diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-12-17 11:36:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 11:36:51 +0100 |
commit | 93f1c67e91939e7f0f933194cb2168ca76c19068 (patch) | |
tree | 76209c4298b6445933c57aa17fa01bcbbb12010b | |
parent | 53af11651b448b34f21f63fb49e74f7186aed30e (diff) | |
parent | 777ca999a999a601b1b4eb3b6147fa77d2ea902c (diff) | |
download | rust-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.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)) } } |