Replace manual iter exhaust with for_each(drop).

This commit is contained in:
Clar Charr
2018-04-04 19:10:38 -04:00
parent 178becdd7c
commit 5c58eec0bd
6 changed files with 9 additions and 13 deletions

View File

@@ -1129,7 +1129,7 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> {
impl<'a, K: 'a, V: 'a> Drop for Drain<'a, K, V> {
fn drop(&mut self) {
for _ in self {}
self.for_each(drop);
}
}