Skip to content

Commit 6256973

Browse files
committed
Rename remaining hashmap and hashtable iterators to match naming
conventions. This is a [breaking-change].
1 parent 7e11b22 commit 6256973

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/libstd/collections/hash/map.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
888888
/// }
889889
/// ```
890890
#[unstable = "matches collection reform specification, waiting for dust to settle"]
891-
pub fn iter(&self) -> Entries<K, V> {
892-
Entries { inner: self.table.iter() }
891+
pub fn iter(&self) -> Iter<K, V> {
892+
Iter { inner: self.table.iter() }
893893
}
894894

895895
/// An iterator visiting all key-value pairs in arbitrary order,
@@ -1305,8 +1305,8 @@ impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> IndexMut<Q, V> for HashMap<K
13051305
}
13061306

13071307
/// HashMap iterator
1308-
pub struct Entries<'a, K: 'a, V: 'a> {
1309-
inner: table::Entries<'a, K, V>
1308+
pub struct Iter<'a, K: 'a, V: 'a> {
1309+
inner: table::Iter<'a, K, V>
13101310
}
13111311

13121312
/// HashMap mutable values iterator
@@ -1326,12 +1326,12 @@ pub struct IntoIter<K, V> {
13261326

13271327
/// HashMap keys iterator
13281328
pub struct Keys<'a, K: 'a, V: 'a> {
1329-
inner: Map<(&'a K, &'a V), &'a K, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
1329+
inner: Map<(&'a K, &'a V), &'a K, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
13301330
}
13311331

13321332
/// HashMap values iterator
13331333
pub struct Values<'a, K: 'a, V: 'a> {
1334-
inner: Map<(&'a K, &'a V), &'a V, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
1334+
inner: Map<(&'a K, &'a V), &'a V, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
13351335
}
13361336

13371337
/// HashMap drain iterator
@@ -1373,7 +1373,7 @@ enum VacantEntryState<K, V, M> {
13731373
NoElem(EmptyBucket<K, V, M>),
13741374
}
13751375

1376-
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> {
1376+
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V> {
13771377
#[inline] fn next(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next() }
13781378
#[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
13791379
}

src/libstd/collections/hash/table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ impl<K, V> RawTable<K, V> {
657657
}
658658
}
659659

660-
pub fn iter(&self) -> Entries<K, V> {
661-
Entries {
660+
pub fn iter(&self) -> Iter<K, V> {
661+
Iter {
662662
iter: self.raw_buckets(),
663663
elems_left: self.size(),
664664
}
@@ -770,7 +770,7 @@ impl<'a, K, V> Iterator<(K, V)> for RevMoveBuckets<'a, K, V> {
770770
}
771771

772772
/// Iterator over shared references to entries in a table.
773-
pub struct Entries<'a, K: 'a, V: 'a> {
773+
pub struct Iter<'a, K: 'a, V: 'a> {
774774
iter: RawBuckets<'a, K, V>,
775775
elems_left: uint,
776776
}
@@ -793,7 +793,7 @@ pub struct Drain<'a, K: 'a, V: 'a> {
793793
iter: RawBuckets<'static, K, V>,
794794
}
795795

796-
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> {
796+
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V> {
797797
fn next(&mut self) -> Option<(&'a K, &'a V)> {
798798
self.iter.next().map(|bucket| {
799799
self.elems_left -= 1;

0 commit comments

Comments
 (0)