about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-26 13:42:31 +0200
committerGitHub <noreply@github.com>2020-04-26 13:42:31 +0200
commit3b3f7bd020b2ff39a14a4047c859675bced55213 (patch)
tree0c9ab9c61f38ecd2229b487d3cf6191ef1b1904f /src/liballoc
parent96c1bb571abd77fcb706d7cdb4a0823a471767c2 (diff)
parent8862f829bbfbc25a2b4e02210a94907787d1cd8b (diff)
downloadrust-3b3f7bd020b2ff39a14a4047c859675bced55213.tar.gz
rust-3b3f7bd020b2ff39a14a4047c859675bced55213.zip
Rollup merge of #71562 - matthiaskrgr:cl7ppy, r=Dylan-DPC
fix more clippy warnings

clippy::{redundant_pattern_matching, clone_on_copy, iter_cloned_collect, option_as_ref_deref, match_ref_pats}

r? @Dylan-DPC
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/binary_heap.rs2
-rw-r--r--src/liballoc/collections/linked_list.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/collections/binary_heap.rs b/src/liballoc/collections/binary_heap.rs
index 8e170d970bc..a3ef9989184 100644
--- a/src/liballoc/collections/binary_heap.rs
+++ b/src/liballoc/collections/binary_heap.rs
@@ -1269,7 +1269,7 @@ impl<'a, T: Ord> Drop for DrainSorted<'a, T> {
 
         impl<'r, 'a, T: Ord> Drop for DropGuard<'r, 'a, T> {
             fn drop(&mut self) {
-                while let Some(_) = self.0.inner.pop() {}
+                while self.0.inner.pop().is_some() {}
             }
         }
 
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs
index 9dd7fc6d7ee..bfa4045787f 100644
--- a/src/liballoc/collections/linked_list.rs
+++ b/src/liballoc/collections/linked_list.rs
@@ -972,7 +972,7 @@ unsafe impl<#[may_dangle] T> Drop for LinkedList<T> {
             fn drop(&mut self) {
                 // Continue the same loop we do below. This only runs when a destructor has
                 // panicked. If another one panics this will abort.
-                while let Some(_) = self.0.pop_front_node() {}
+                while self.0.pop_front_node().is_some() {}
             }
         }