diff --git a/src/arrayvec.rs b/src/arrayvec.rs index 893028b..e87b3ef 100644 --- a/src/arrayvec.rs +++ b/src/arrayvec.rs @@ -880,6 +880,17 @@ pub struct IntoIter { index: usize, v: ArrayVec, } +impl IntoIter { + /// Returns the remaining items of this iterator as a slice. + pub fn as_slice(&self) -> &[T] { + &self.v[self.index..] + } + + /// Returns the remaining items of this iterator as a mutable slice. + pub fn as_mut_slice(&mut self) -> &mut [T] { + &mut self.v[self.index..] + } +} impl Iterator for IntoIter { type Item = T;