Skip to content

Commit 520ab2b

Browse files
committed
Fix the type of GcIndexMap::keys
Maybe we should try at least some basic testing...
1 parent e99e9ab commit 520ab2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hash_map/indexmap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ macro_rules! define_iterator {
204204
#[doc = concat!("An iterator over the ", $item_name, " of a [GcIndexMap]")]
205205
pub struct $name<'a, K: 'a, V: 'a>(core::slice::$wrapped<'a, Bucket<K, V>>);
206206
impl<'a, K: 'a, V: 'a> Iterator for $name<'a, K, V> {
207-
type Item = (&'a K, &'a V);
207+
type Item = $item;
208208
#[inline]
209209
fn next(&mut self) -> Option<Self::Item> {
210-
self.0.next().map(|$bucket| (&$bucket.key, &$bucket.value))
210+
self.0.next().map(|$bucket| $map)
211211
}
212212
#[inline]
213213
fn size_hint(&self) -> (usize, Option<usize>) {
@@ -217,7 +217,7 @@ macro_rules! define_iterator {
217217
impl<'a, K, V> DoubleEndedIterator for $name<'a, K, V> {
218218
#[inline]
219219
fn next_back(&mut self) -> Option<Self::Item> {
220-
self.0.next_back().map(|$bucket| (&$bucket.key, &$bucket.value))
220+
self.0.next_back().map(|$bucket| $map)
221221
}
222222
}
223223
impl<'a, K, V> core::iter::ExactSizeIterator for $name<'a, K, V> {}

0 commit comments

Comments
 (0)