diff options
| author | Tim Vermeulen <tvermeulen@me.com> | 2019-03-18 17:08:53 +0100 |
|---|---|---|
| committer | Tim Vermeulen <tvermeulen@me.com> | 2019-03-18 17:08:53 +0100 |
| commit | 075b2697e47e9370dcf2d38f01469b38bd4d903e (patch) | |
| tree | 8d4a8e77b3d3717bb7cd2a9e0aba8441e00e3adb | |
| parent | 67783964de78299475cf826b0021040ef783e373 (diff) | |
| download | rust-075b2697e47e9370dcf2d38f01469b38bd4d903e.tar.gz rust-075b2697e47e9370dcf2d38f01469b38bd4d903e.zip | |
Simplify Iterator::{lt, gt}
| -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 84db233c630..6df4a457655 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -2451,10 +2451,7 @@ pub trait Iterator { Self::Item: PartialOrd<I::Item>, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Less) => true, - _ => false, - } + self.partial_cmp(other) == Some(Ordering::Less) } /// Determines if the elements of this `Iterator` are lexicographically @@ -2479,10 +2476,7 @@ pub trait Iterator { Self::Item: PartialOrd<I::Item>, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Greater) => true, - _ => false, - } + self.partial_cmp(other) == Some(Ordering::Greater) } /// Determines if the elements of this `Iterator` are lexicographically |
