From 8862f829bbfbc25a2b4e02210a94907787d1cd8b Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sat, 25 Apr 2020 10:17:14 +0200 Subject: fix more clippy warnings clippy::{redundant_pattern_matching, clone_on_copy, iter_cloned_collect, option_as_ref_deref, match_ref_pats} --- src/liballoc/collections/binary_heap.rs | 2 +- src/liballoc/collections/linked_list.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/liballoc') 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 { 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() {} } } -- cgit 1.4.1-3-g733a5 From 35eae4bad2a1bd21593aa8a58af0e5b3de965bad Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 26 Apr 2020 12:31:05 +0200 Subject: Fix stable(since) attribute for BTreeMap::remove_entry --- src/liballoc/collections/btree/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/liballoc') diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index 099687bd6b0..c0b976565e4 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -930,7 +930,7 @@ impl BTreeMap { /// assert_eq!(map.remove_entry(&1), Some((1, "a"))); /// assert_eq!(map.remove_entry(&1), None); /// ``` - #[stable(feature = "btreemap_remove_entry", since = "1.44.0")] + #[stable(feature = "btreemap_remove_entry", since = "1.45.0")] pub fn remove_entry(&mut self, key: &Q) -> Option<(K, V)> where K: Borrow, -- cgit 1.4.1-3-g733a5