melib: add into_iter() for &StackVec<T>

jmap
Manos Pitsidianakis 2019-11-16 20:21:47 +02:00
parent b01b9ffbcb
commit dfa83e486c
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 10 additions and 0 deletions

View File

@ -186,6 +186,16 @@ impl<T: Default + Copy + std::fmt::Debug> IntoIterator for StackVec<T> {
StackVecIterOwned(self)
}
}
impl<'a, T: Default + Copy + std::fmt::Debug> IntoIterator for &'a StackVec<T> {
type Item = &'a T;
type IntoIter = StackVecIter<'a, T>;
fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}
impl<T: Default + Copy + std::fmt::Debug> Iterator for StackVecIterOwned<T> {
type Item = T;
fn next(&mut self) -> Option<T> {