Use if-let in is_sorted_by
This commit is contained in:
parent
e67620afc4
commit
95e2a4f23d
1 changed files with 2 additions and 3 deletions
|
|
@ -2740,9 +2740,8 @@ pub trait Iterator {
|
|||
};
|
||||
|
||||
while let Some(curr) = self.next() {
|
||||
match compare(&last, &curr) {
|
||||
Some(Ordering::Greater) | None => return false,
|
||||
_ => {}
|
||||
if let Some(Ordering::Greater) | None = compare(&last, &curr) {
|
||||
return false;
|
||||
}
|
||||
last = curr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue