rseip_core/iter.rs
1// rseip
2//
3// rseip - Ethernet/IP (CIP) in pure Rust.
4// Copyright: 2021, Joylei <leingliu@gmail.com>
5// License: MIT
6
7use smallvec::{Array, SmallVec};
8
9/// smallvec IntoIter proxy
10pub struct IntoIter<A: Array>(smallvec::IntoIter<A>);
11
12impl<A: Array> IntoIter<A> {
13 #[inline]
14 pub fn new(vec: SmallVec<A>) -> Self {
15 Self(vec.into_iter())
16 }
17}
18
19impl<A: Array> Iterator for IntoIter<A> {
20 type Item = A::Item;
21 #[inline]
22 fn next(&mut self) -> Option<Self::Item> {
23 self.0.next()
24 }
25}