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/librustc_data_structures | |
| parent | 178becdd7c86d87b24951af18e4b7d45f3e1e7bc (diff) | |
| download | rust-5c58eec0bd8cee8fb2a191396d5ad5b5c9b0116a.tar.gz rust-5c58eec0bd8cee8fb2a191396d5ad5b5c9b0116a.zip | |
Replace manual iter exhaust with for_each(drop).
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/array_vec.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_data_structures/array_vec.rs b/src/librustc_data_structures/array_vec.rs index 511c407d45a..34e19bba08b 100644 --- a/src/librustc_data_structures/array_vec.rs +++ b/src/librustc_data_structures/array_vec.rs @@ -207,7 +207,7 @@ pub struct Iter<A: Array> { impl<A: Array> Drop for Iter<A> { fn drop(&mut self) { - for _ in self {} + self.for_each(drop); } } @@ -251,7 +251,7 @@ impl<'a, A: Array> Iterator for Drain<'a, A> { impl<'a, A: Array> Drop for Drain<'a, A> { fn drop(&mut self) { // exhaust self first - while let Some(_) = self.next() {} + self.for_each(drop); if self.tail_len > 0 { unsafe { |
