non-empty-collections 0.1.9

Non-empty hash-map and hash-set implementations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use indexmap::map::IntoIter as HashIter;
use std::iter::{Chain, Once};

/// A type produced by `NonEmptyIndexMap::into_iter`.
pub struct IntoIter<K, V> {
    pub(super) iter: Chain<Once<(K, V)>, HashIter<K, V>>,
}

impl<K, V> Iterator for IntoIter<K, V> {
    type Item = (K, V);

    fn next(&mut self) -> Option<Self::Item> {
        self.iter.next()
    }
}