mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 18:12:51 +00:00
Use if-let in is_sorted_by
This commit is contained in:
parent
e67620afc4
commit
95e2a4f23d
@ -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…
Reference in New Issue
Block a user