about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2019-07-05 18:28:27 -0700
committerJosh Stone <jistone@redhat.com>2019-08-12 15:03:44 -0700
commit95e2a4f23df096ce61593b6a0910d67508228bc7 (patch)
tree3d03a0b00c0ebdae90bcb52ee80381784a0ea54f
parente67620afc4a5b22960a5f1b056cbc4b878beb2e8 (diff)
downloadrust-95e2a4f23df096ce61593b6a0910d67508228bc7.tar.gz
rust-95e2a4f23df096ce61593b6a0910d67508228bc7.zip
Use if-let in is_sorted_by
-rw-r--r--src/libcore/iter/traits/iterator.rs5
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;
         }