Browse Source

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

jmap
Manos Pitsidianakis 2 years ago
parent
commit
dfa83e486c
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 10
      melib/src/structs.rs

10
melib/src/structs.rs

@ -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> {

Loading…
Cancel
Save