Skip to content

Commit 7b929e7

Browse files
authored
Implement IntoIterator for our OOM-handling Vec (#12472)
1 parent 9cc85ab commit 7b929e7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/core/src/alloc/vec.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ impl<T> IndexMut<usize> for Vec<T> {
143143
}
144144
}
145145

146+
impl<T> IntoIterator for Vec<T> {
147+
type Item = T;
148+
type IntoIter = std_alloc::vec::IntoIter<T>;
149+
150+
fn into_iter(self) -> Self::IntoIter {
151+
self.inner.into_iter()
152+
}
153+
}
154+
146155
impl<'a, T> IntoIterator for &'a Vec<T> {
147156
type Item = &'a T;
148157

0 commit comments

Comments
 (0)