#[cfg(test)]
mod tests;
use {
crate::pos_vec::pos::{InUse, Pos},
core::{
fmt::{Debug, Formatter},
iter::FusedIterator,
},
hashbrown::hash_map,
};
pub struct IntoKeys<K> {
pub(crate) iter: hash_map::IntoKeys<K, Pos<InUse>>,
}
impl<K> Iterator for IntoKeys<K> {
type Item = K;
fn next(&mut self) -> Option<Self::Item> {
self.iter.next()
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}
}
impl<K> Debug for IntoKeys<K> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("IntoKeys").finish_non_exhaustive()
}
}
impl<K> FusedIterator for IntoKeys<K> {}
impl<K> ExactSizeIterator for IntoKeys<K> {
fn len(&self) -> usize {
self.iter.len()
}
}
impl<K> Default for IntoKeys<K> {
fn default() -> Self {
Self {
iter: Default::default(),
}
}
}
unsafe impl<K> Send for IntoKeys<K> where K: Send {}
unsafe impl<K> Sync for IntoKeys<K> where K: Sync {}