bumpish 0.2.0

A set of collections using bump allocations
Documentation
use super::*;
use crate::map;
use crate::util::{impl_deiter, impl_iter};

pub struct Iter<'a, T> {
    iter: map::Iter<'a, T, ()>,
}

impl<'a, T> Iter<'a, T> {
    pub(super) fn new(map_iter: map::Iter<'a, T, ()>) -> Self {
        Self { iter: map_iter }
    }
}

impl_iter!(|(k, _)| k, Iter<'a, T> => &'a T);
impl_deiter!(|(k, _)| k, Iter<'a, T>);

pub struct IntoIter<T> {
    iter: map::IntoIter<T, ()>,
}

impl<T> IntoIter<T> {
    pub(super) fn new(map_iter: map::IntoIter<T, ()>) -> Self {
        Self { iter: map_iter }
    }
}

impl_iter!(|(k, _)| k, IntoIter<T> => T);

pub struct Drain<'a, T: Eq> {
    iter: map::Drain<'a, T, ()>,
}

impl<'a, T: Eq> Drain<'a, T> {
    pub(super) fn new(map_iter: map::Drain<'a, T, ()>) -> Self {
        Self { iter: map_iter }
    }
}

impl<T: Eq> core::iter::Iterator for Drain<'_, T> {
    type Item = T;

    fn next(&mut self) -> Option<Self::Item> {
        self.iter.next().map(|(k, _)| k)
    }
}