diff options
| author | Josh Stone <jistone@redhat.com> | 2019-07-05 18:28:27 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2019-08-12 15:03:44 -0700 |
| commit | 95e2a4f23df096ce61593b6a0910d67508228bc7 (patch) | |
| tree | 3d03a0b00c0ebdae90bcb52ee80381784a0ea54f | |
| parent | e67620afc4a5b22960a5f1b056cbc4b878beb2e8 (diff) | |
| download | rust-95e2a4f23df096ce61593b6a0910d67508228bc7.tar.gz rust-95e2a4f23df096ce61593b6a0910d67508228bc7.zip | |
Use if-let in is_sorted_by
| -rw-r--r-- | src/libcore/iter/traits/iterator.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index 9028103cb97..4220e85b8dd 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -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; } |
