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::set::IntoIter as HashIter;
use std::iter::{Chain, Once};

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

impl<K> Iterator for IntoIter<K> {
    type Item = K;

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