Simplify Iterator::{lt, gt}
This commit is contained in:
parent
67783964de
commit
075b2697e4
1 changed files with 2 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue