mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Implement size_hint for the hashmap iterators
This commit is contained in:
parent
416f238062
commit
2d23f0a36c
|
@ -351,6 +351,10 @@ impl<'a, K, V, ALLOCATOR: ClonableAllocator> Iterator for Iter<'a, K, V, ALLOCAT
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.map.len(), Some(self.map.len()))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, K, V, ALLOCATOR: ClonableAllocator> IntoIterator for &'a HashMap<K, V, ALLOCATOR> {
|
||||
|
@ -388,6 +392,10 @@ impl<K, V, ALLOCATOR: ClonableAllocator> Iterator for IterOwned<K, V, ALLOCATOR>
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.map.len(), Some(self.map.len()))
|
||||
}
|
||||
}
|
||||
|
||||
/// An iterator over entries of a [`HashMap`]
|
||||
|
|
Loading…
Reference in a new issue