1
Fork 0

Simplify Iterator::{lt, gt}

This commit is contained in:
Tim Vermeulen 2019-03-18 17:08:53 +01:00
parent 67783964de
commit 075b2697e4

View file

@ -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