fixed #1 IntoIter memory leak

This commit is contained in:
nora 2021-08-10 22:50:38 +02:00
parent ffde519487
commit 3102f61870

View file

@ -447,6 +447,12 @@ impl<T> IntoIter<T> {
}
}
impl<T> Drop for IntoIter<T> {
fn drop(&mut self) {
while let Some(_) = self.next() {}
}
}
impl<T> Iterator for IntoIter<T> {
type Item = T;