about summary refs log tree commit diff
path: root/src/libcore/cmp.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-17 03:05:19 +0200
committerGitHub <noreply@github.com>2020-04-17 03:05:19 +0200
commit28964b4ef2f165fdc667367bd9ba6b8d4cf81d34 (patch)
tree42e3f3a3456786349d5ca1fbeff0a34221e2ad6a /src/libcore/cmp.rs
parentb2e4d4836f7890fc069d5c62086e1015b9d94ff2 (diff)
parent2edd123a233fff2fbccd17299e0c14d2203e1acc (diff)
downloadrust-28964b4ef2f165fdc667367bd9ba6b8d4cf81d34.tar.gz
rust-28964b4ef2f165fdc667367bd9ba6b8d4cf81d34.zip
Rollup merge of #71220 - cuviper:std_or_patterns, r=Mark-Simulacrum
Dogfood or_patterns in the standard library

We can start using `or_patterns` in the standard library as a step toward stabilization.

cc #54883 @Centril
Diffstat (limited to 'src/libcore/cmp.rs')
-rw-r--r--src/libcore/cmp.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 8c542136a7f..335969b3ef0 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -858,7 +858,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn le(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Less) | Some(Equal))
+        matches!(self.partial_cmp(other), Some(Less | Equal))
     }
 
     /// This method tests greater than (for `self` and `other`) and is used by the `>` operator.
@@ -895,7 +895,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn ge(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Greater) | Some(Equal))
+        matches!(self.partial_cmp(other), Some(Greater | Equal))
     }
 }