Skip to content

Commit 95e2a4f

Browse files
committed
Use if-let in is_sorted_by
1 parent e67620a commit 95e2a4f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libcore/iter/traits/iterator.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,9 +2740,8 @@ pub trait Iterator {
27402740
};
27412741

27422742
while let Some(curr) = self.next() {
2743-
match compare(&last, &curr) {
2744-
Some(Ordering::Greater) | None => return false,
2745-
_ => {}
2743+
if let Some(Ordering::Greater) | None = compare(&last, &curr) {
2744+
return false;
27462745
}
27472746
last = curr;
27482747
}

0 commit comments

Comments
 (0)