diff options
| author | Clar Charr <clar@charr.xyz> | 2018-04-04 19:10:38 -0400 |
|---|---|---|
| committer | Clar Charr <clar@charr.xyz> | 2018-04-04 19:10:38 -0400 |
| commit | 5c58eec0bd8cee8fb2a191396d5ad5b5c9b0116a (patch) | |
| tree | 008deaf9de29022f5d794bbedf739049a5eca248 /src/liballoc/btree | |
| parent | 178becdd7c86d87b24951af18e4b7d45f3e1e7bc (diff) | |
Replace manual iter exhaust with for_each(drop).
Diffstat (limited to 'src/liballoc/btree')
| -rw-r--r-- | src/liballoc/btree/map.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs index ed9c8c18f0d..37274a3c3ec 100644 --- a/src/liballoc/btree/map.rs +++ b/src/liballoc/btree/map.rs @@ -1260,8 +1260,7 @@ impl<K, V> IntoIterator for BTreeMap<K, V> { #[stable(feature = "btree_drop", since = "1.7.0")] impl<K, V> Drop for IntoIter<K, V> { fn drop(&mut self) { - for _ in &mut *self { - } + self.for_each(drop); unsafe { let leaf_node = ptr::read(&self.front).into_node(); if let Some(first_parent) = leaf_node.deallocate_and_ascend() { |
