diff options
| author | Igor Aleksanov <popzxc@yandex.ru> | 2020-01-07 10:35:16 +0300 |
|---|---|---|
| committer | Igor Aleksanov <popzxc@yandex.ru> | 2020-01-08 07:10:28 +0300 |
| commit | f720469fd0c4dff6d92e2f778ea2f252f76dcc2e (patch) | |
| tree | eed0768e1946a78b266025d661016f190795d871 /src/libcore/iter | |
| parent | aa0769b92e60f5298f0b6326b8654c9b04351b98 (diff) | |
| download | rust-f720469fd0c4dff6d92e2f778ea2f252f76dcc2e.tar.gz rust-f720469fd0c4dff6d92e2f778ea2f252f76dcc2e.zip | |
Use matches macro in libcore and libstd
Diffstat (limited to 'src/libcore/iter')
| -rw-r--r-- | src/libcore/iter/traits/iterator.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index c958289b2c9..21a569867b1 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -2968,10 +2968,7 @@ pub trait Iterator { Self::Item: PartialOrd<I::Item>, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Less) | Some(Ordering::Equal) => true, - _ => false, - } + matches!(self.partial_cmp(other), Some(Ordering::Less) | Some(Ordering::Equal)) } /// Determines if the elements of this `Iterator` are lexicographically @@ -3011,10 +3008,7 @@ pub trait Iterator { Self::Item: PartialOrd<I::Item>, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Greater) | Some(Ordering::Equal) => true, - _ => false, - } + matches!(self.partial_cmp(other), Some(Ordering::Greater) | Some(Ordering::Equal)) } /// Checks if the elements of this iterator are sorted. |
