non_empty_collections/index_map/into_iter.rs
1use indexmap::map::IntoIter as HashIter;
2use std::iter::{Chain, Once};
3
4/// A type produced by `NonEmptyIndexMap::into_iter`.
5pub struct IntoIter<K, V> {
6 pub(super) iter: Chain<Once<(K, V)>, HashIter<K, V>>,
7}
8
9impl<K, V> Iterator for IntoIter<K, V> {
10 type Item = (K, V);
11
12 fn next(&mut self) -> Option<Self::Item> {
13 self.iter.next()
14 }
15}