extern crate alloc;
use super::super::DotStore;
use super::DotMap;
pub struct DotMapIter<'a, K, S> {
inner: alloc::collections::btree_map::Iter<'a, K, S>,
}
impl<'a, K, S> DotMapIter<'a, K, S> {
pub(super) const fn new(inner: alloc::collections::btree_map::Iter<'a, K, S>) -> Self {
Self { inner }
}
}
impl<'a, K, S> Iterator for DotMapIter<'a, K, S> {
type Item = (&'a K, &'a S);
fn next(&mut self) -> Option<Self::Item> {
self.inner.next()
}
}
impl<'a, K: Ord + Clone, S: DotStore> IntoIterator for &'a DotMap<K, S> {
type Item = (&'a K, &'a S);
type IntoIter = DotMapIter<'a, K, S>;
fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}