diff --git a/melib/src/structs.rs b/melib/src/structs.rs index 356c9beb..569f7dab 100644 --- a/melib/src/structs.rs +++ b/melib/src/structs.rs @@ -186,6 +186,16 @@ impl IntoIterator for StackVec { StackVecIterOwned(self) } } + +impl<'a, T: Default + Copy + std::fmt::Debug> IntoIterator for &'a StackVec { + type Item = &'a T; + type IntoIter = StackVecIter<'a, T>; + + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + impl Iterator for StackVecIterOwned { type Item = T; fn next(&mut self) -> Option {