extern crate alloc;
use alloc::collections::btree_map;
#[derive(Debug, Clone)]
pub struct Iter<'a> {
inner: btree_map::Iter<'a, u32, u64>,
}
impl<'a> Iter<'a> {
pub(super) const fn new(inner: btree_map::Iter<'a, u32, u64>) -> Self {
Self { inner }
}
}
impl Iterator for Iter<'_> {
type Item = (u32, u64);
fn next(&mut self) -> Option<Self::Item> {
self.inner
.next()
.map(|(&station, &counter)| (station, counter))
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}
impl ExactSizeIterator for Iter<'_> {
fn len(&self) -> usize {
self.inner.len()
}
}
impl core::iter::FusedIterator for Iter<'_> {}