diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-17 03:05:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-17 03:05:19 +0200 |
| commit | 28964b4ef2f165fdc667367bd9ba6b8d4cf81d34 (patch) | |
| tree | 42e3f3a3456786349d5ca1fbeff0a34221e2ad6a /src/libcore/cmp.rs | |
| parent | b2e4d4836f7890fc069d5c62086e1015b9d94ff2 (diff) | |
| parent | 2edd123a233fff2fbccd17299e0c14d2203e1acc (diff) | |
| download | rust-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.rs | 4 |
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)) } } |
