Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 777ca99

Browse files
committedDec 14, 2020
Optimization for bool's PartialOrd impl
1 parent 1f7762b commit 777ca99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎library/core/src/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ mod impls {
12361236
impl PartialOrd for bool {
12371237
#[inline]
12381238
fn partial_cmp(&self, other: &bool) -> Option<Ordering> {
1239-
(*self as u8).partial_cmp(&(*other as u8))
1239+
Some(self.cmp(other))
12401240
}
12411241
}
12421242

0 commit comments

Comments
 (0)
Please sign in to comment.