Skip to content

Commit 22050e3

Browse files
committed
Added missing renames:
libcollections: AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union libstd/hash/{table, map}: Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut Also a [breaking-change].
1 parent f8cfd24 commit 22050e3

File tree

8 files changed

+82
-81
lines changed

8 files changed

+82
-81
lines changed

src/libcollections/binary_heap.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ impl<T: Ord> BinaryHeap<T> {
240240
/// ```
241241
#[unstable = "matches collection reform specification, waiting for dust to settle"]
242242
pub fn iter(&self) -> Iter<T> {
243-
Iter { iter: self.data.iter() } }
243+
Iter { iter: self.data.iter() }
244+
}
244245

245246
/// Creates a consuming iterator, that is, one that moves each value out of
246247
/// the binary heap in arbitrary order. The binary heap cannot be used

src/libcollections/btree/map.rs

+29-29
Original file line numberDiff line numberDiff line change
@@ -88,36 +88,36 @@ pub struct BTreeMap<K, V> {
8888
}
8989

9090
/// An abstract base over-which all other BTree iterators are built.
91-
struct AbsEntries<T> {
91+
struct AbsIter<T> {
9292
lca: T,
9393
left: RingBuf<T>,
9494
right: RingBuf<T>,
9595
size: uint,
9696
}
9797

9898
/// An iterator over a BTreeMap's entries.
99-
pub struct Entries<'a, K: 'a, V: 'a> {
100-
inner: AbsEntries<Traversal<'a, K, V>>
99+
pub struct Iter<'a, K: 'a, V: 'a> {
100+
inner: AbsIter<Traversal<'a, K, V>>
101101
}
102102

103103
/// A mutable iterator over a BTreeMap's entries.
104-
pub struct MutEntries<'a, K: 'a, V: 'a> {
105-
inner: AbsEntries<MutTraversal<'a, K, V>>
104+
pub struct IterMut<'a, K: 'a, V: 'a> {
105+
inner: AbsIter<MutTraversal<'a, K, V>>
106106
}
107107

108108
/// An owning iterator over a BTreeMap's entries.
109-
pub struct MoveEntries<K, V> {
110-
inner: AbsEntries<MoveTraversal<K, V>>
109+
pub struct IntoIter<K, V> {
110+
inner: AbsIter<MoveTraversal<K, V>>
111111
}
112112

113113
/// An iterator over a BTreeMap's keys.
114114
pub struct Keys<'a, K: 'a, V: 'a> {
115-
inner: Map<(&'a K, &'a V), &'a K, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
115+
inner: Map<(&'a K, &'a V), &'a K, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
116116
}
117117

118118
/// An iterator over a BTreeMap's values.
119119
pub struct Values<'a, K: 'a, V: 'a> {
120-
inner: Map<(&'a K, &'a V), &'a V, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
120+
inner: Map<(&'a K, &'a V), &'a V, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
121121
}
122122

123123
/// A view into a single entry in a map, which may either be vacant or occupied.
@@ -929,7 +929,7 @@ enum StackOp<T> {
929929
}
930930

931931
impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
932-
Iterator<(K, V)> for AbsEntries<T> {
932+
Iterator<(K, V)> for AbsIter<T> {
933933
// This function is pretty long, but only because there's a lot of cases to consider.
934934
// Our iterator represents two search paths, left and right, to the smallest and largest
935935
// elements we have yet to yield. lca represents the least common ancestor of these two paths,
@@ -995,7 +995,7 @@ impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
995995
}
996996

997997
impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
998-
DoubleEndedIterator<(K, V)> for AbsEntries<T> {
998+
DoubleEndedIterator<(K, V)> for AbsIter<T> {
999999
// next_back is totally symmetric to next
10001000
fn next_back(&mut self) -> Option<(K, V)> {
10011001
loop {
@@ -1032,34 +1032,34 @@ impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
10321032
}
10331033
}
10341034

1035-
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> {
1035+
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V> {
10361036
fn next(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next() }
10371037
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10381038
}
1039-
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a V)> for Entries<'a, K, V> {
1039+
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a V)> for Iter<'a, K, V> {
10401040
fn next_back(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next_back() }
10411041
}
1042-
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a V)> for Entries<'a, K, V> {}
1042+
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a V)> for Iter<'a, K, V> {}
10431043

10441044

1045-
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
1045+
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {
10461046
fn next(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next() }
10471047
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10481048
}
1049-
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
1049+
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {
10501050
fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next_back() }
10511051
}
1052-
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {}
1052+
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {}
10531053

10541054

1055-
impl<K, V> Iterator<(K, V)> for MoveEntries<K, V> {
1055+
impl<K, V> Iterator<(K, V)> for IntoIter<K, V> {
10561056
fn next(&mut self) -> Option<(K, V)> { self.inner.next() }
10571057
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10581058
}
1059-
impl<K, V> DoubleEndedIterator<(K, V)> for MoveEntries<K, V> {
1059+
impl<K, V> DoubleEndedIterator<(K, V)> for IntoIter<K, V> {
10601060
fn next_back(&mut self) -> Option<(K, V)> { self.inner.next_back() }
10611061
}
1062-
impl<K, V> ExactSizeIterator<(K, V)> for MoveEntries<K, V> {}
1062+
impl<K, V> ExactSizeIterator<(K, V)> for IntoIter<K, V> {}
10631063

10641064

10651065
impl<'a, K, V> Iterator<&'a K> for Keys<'a, K, V> {
@@ -1140,10 +1140,10 @@ impl<K, V> BTreeMap<K, V> {
11401140
/// assert_eq!((*first_key, *first_value), (1u, "a"));
11411141
/// ```
11421142
#[unstable = "matches collection reform specification, waiting for dust to settle"]
1143-
pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
1143+
pub fn iter<'a>(&'a self) -> Iter<'a, K, V> {
11441144
let len = self.len();
1145-
Entries {
1146-
inner: AbsEntries {
1145+
Iter {
1146+
inner: AbsIter {
11471147
lca: Traverse::traverse(&self.root),
11481148
left: RingBuf::new(),
11491149
right: RingBuf::new(),
@@ -1172,10 +1172,10 @@ impl<K, V> BTreeMap<K, V> {
11721172
/// }
11731173
/// ```
11741174
#[unstable = "matches collection reform specification, waiting for dust to settle"]
1175-
pub fn iter_mut<'a>(&'a mut self) -> MutEntries<'a, K, V> {
1175+
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, K, V> {
11761176
let len = self.len();
1177-
MutEntries {
1178-
inner: AbsEntries {
1177+
IterMut {
1178+
inner: AbsIter {
11791179
lca: Traverse::traverse(&mut self.root),
11801180
left: RingBuf::new(),
11811181
right: RingBuf::new(),
@@ -1201,10 +1201,10 @@ impl<K, V> BTreeMap<K, V> {
12011201
/// }
12021202
/// ```
12031203
#[unstable = "matches collection reform specification, waiting for dust to settle"]
1204-
pub fn into_iter(self) -> MoveEntries<K, V> {
1204+
pub fn into_iter(self) -> IntoIter<K, V> {
12051205
let len = self.len();
1206-
MoveEntries {
1207-
inner: AbsEntries {
1206+
IntoIter {
1207+
inner: AbsIter {
12081208
lca: Traverse::traverse(self.root),
12091209
left: RingBuf::new(),
12101210
right: RingBuf::new(),

src/libcollections/btree/set.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use core::prelude::*;
1515

16-
use btree_map::{BTreeMap, Keys, MoveEntries};
16+
use btree_map::{BTreeMap, Keys};
1717
use std::hash::Hash;
1818
use core::borrow::BorrowFrom;
1919
use core::default::Default;
@@ -39,29 +39,29 @@ pub struct Iter<'a, T: 'a> {
3939

4040
/// An owning iterator over a BTreeSet's items.
4141
pub struct IntoIter<T> {
42-
iter: Map<(T, ()), T, MoveEntries<T, ()>, fn((T, ())) -> T>
42+
iter: Map<(T, ()), T, ::btree_map::IntoIter<T, ()>, fn((T, ())) -> T>
4343
}
4444

4545
/// A lazy iterator producing elements in the set difference (in-order).
46-
pub struct DifferenceItems<'a, T:'a> {
46+
pub struct Difference<'a, T:'a> {
4747
a: Peekable<&'a T, Iter<'a, T>>,
4848
b: Peekable<&'a T, Iter<'a, T>>,
4949
}
5050

5151
/// A lazy iterator producing elements in the set symmetric difference (in-order).
52-
pub struct SymDifferenceItems<'a, T:'a> {
52+
pub struct SymmetricDifference<'a, T:'a> {
5353
a: Peekable<&'a T, Iter<'a, T>>,
5454
b: Peekable<&'a T, Iter<'a, T>>,
5555
}
5656

5757
/// A lazy iterator producing elements in the set intersection (in-order).
58-
pub struct IntersectionItems<'a, T:'a> {
58+
pub struct Intersection<'a, T:'a> {
5959
a: Peekable<&'a T, Iter<'a, T>>,
6060
b: Peekable<&'a T, Iter<'a, T>>,
6161
}
6262

6363
/// A lazy iterator producing elements in the set union (in-order).
64-
pub struct UnionItems<'a, T:'a> {
64+
pub struct Union<'a, T:'a> {
6565
a: Peekable<&'a T, Iter<'a, T>>,
6666
b: Peekable<&'a T, Iter<'a, T>>,
6767
}
@@ -151,8 +151,8 @@ impl<T: Ord> BTreeSet<T> {
151151
/// assert_eq!(diff, vec![1u]);
152152
/// ```
153153
#[unstable = "matches collection reform specification, waiting for dust to settle"]
154-
pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> DifferenceItems<'a, T> {
155-
DifferenceItems{a: self.iter().peekable(), b: other.iter().peekable()}
154+
pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T> {
155+
Difference{a: self.iter().peekable(), b: other.iter().peekable()}
156156
}
157157

158158
/// Visits the values representing the symmetric difference, in ascending order.
@@ -175,8 +175,8 @@ impl<T: Ord> BTreeSet<T> {
175175
/// ```
176176
#[unstable = "matches collection reform specification, waiting for dust to settle"]
177177
pub fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>)
178-
-> SymDifferenceItems<'a, T> {
179-
SymDifferenceItems{a: self.iter().peekable(), b: other.iter().peekable()}
178+
-> SymmetricDifference<'a, T> {
179+
SymmetricDifference{a: self.iter().peekable(), b: other.iter().peekable()}
180180
}
181181

182182
/// Visits the values representing the intersection, in ascending order.
@@ -199,8 +199,8 @@ impl<T: Ord> BTreeSet<T> {
199199
/// ```
200200
#[unstable = "matches collection reform specification, waiting for dust to settle"]
201201
pub fn intersection<'a>(&'a self, other: &'a BTreeSet<T>)
202-
-> IntersectionItems<'a, T> {
203-
IntersectionItems{a: self.iter().peekable(), b: other.iter().peekable()}
202+
-> Intersection<'a, T> {
203+
Intersection{a: self.iter().peekable(), b: other.iter().peekable()}
204204
}
205205

206206
/// Visits the values representing the union, in ascending order.
@@ -220,8 +220,8 @@ impl<T: Ord> BTreeSet<T> {
220220
/// assert_eq!(union, vec![1u,2]);
221221
/// ```
222222
#[unstable = "matches collection reform specification, waiting for dust to settle"]
223-
pub fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> UnionItems<'a, T> {
224-
UnionItems{a: self.iter().peekable(), b: other.iter().peekable()}
223+
pub fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> Union<'a, T> {
224+
Union{a: self.iter().peekable(), b: other.iter().peekable()}
225225
}
226226

227227
/// Return the number of elements in the set
@@ -573,7 +573,7 @@ fn cmp_opt<T: Ord>(x: Option<&T>, y: Option<&T>,
573573
}
574574
}
575575

576-
impl<'a, T: Ord> Iterator<&'a T> for DifferenceItems<'a, T> {
576+
impl<'a, T: Ord> Iterator<&'a T> for Difference<'a, T> {
577577
fn next(&mut self) -> Option<&'a T> {
578578
loop {
579579
match cmp_opt(self.a.peek(), self.b.peek(), Less, Less) {
@@ -585,7 +585,7 @@ impl<'a, T: Ord> Iterator<&'a T> for DifferenceItems<'a, T> {
585585
}
586586
}
587587

588-
impl<'a, T: Ord> Iterator<&'a T> for SymDifferenceItems<'a, T> {
588+
impl<'a, T: Ord> Iterator<&'a T> for SymmetricDifference<'a, T> {
589589
fn next(&mut self) -> Option<&'a T> {
590590
loop {
591591
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
@@ -597,7 +597,7 @@ impl<'a, T: Ord> Iterator<&'a T> for SymDifferenceItems<'a, T> {
597597
}
598598
}
599599

600-
impl<'a, T: Ord> Iterator<&'a T> for IntersectionItems<'a, T> {
600+
impl<'a, T: Ord> Iterator<&'a T> for Intersection<'a, T> {
601601
fn next(&mut self) -> Option<&'a T> {
602602
loop {
603603
let o_cmp = match (self.a.peek(), self.b.peek()) {
@@ -615,7 +615,7 @@ impl<'a, T: Ord> Iterator<&'a T> for IntersectionItems<'a, T> {
615615
}
616616
}
617617

618-
impl<'a, T: Ord> Iterator<&'a T> for UnionItems<'a, T> {
618+
impl<'a, T: Ord> Iterator<&'a T> for Union<'a, T> {
619619
fn next(&mut self) -> Option<&'a T> {
620620
loop {
621621
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {

src/libcollections/vec_map.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ impl<V> VecMap<V> {
176176
/// }
177177
/// ```
178178
#[unstable = "matches collection reform specification, waiting for dust to settle"]
179-
pub fn iter<'r>(&'r self) -> Entries<'r, V> {
180-
Entries {
179+
pub fn iter<'r>(&'r self) -> Iter<'r, V> {
180+
Iter {
181181
front: 0,
182182
back: self.v.len(),
183183
iter: self.v.iter()
@@ -207,8 +207,8 @@ impl<V> VecMap<V> {
207207
/// }
208208
/// ```
209209
#[unstable = "matches collection reform specification, waiting for dust to settle"]
210-
pub fn iter_mut<'r>(&'r mut self) -> MutEntries<'r, V> {
211-
MutEntries {
210+
pub fn iter_mut<'r>(&'r mut self) -> IterMut<'r, V> {
211+
IterMut {
212212
front: 0,
213213
back: self.v.len(),
214214
iter: self.v.iter_mut()
@@ -605,34 +605,34 @@ macro_rules! double_ended_iterator {
605605
}
606606

607607
/// An iterator over the key-value pairs of a map.
608-
pub struct Entries<'a, V:'a> {
608+
pub struct Iter<'a, V:'a> {
609609
front: uint,
610610
back: uint,
611611
iter: slice::Iter<'a, Option<V>>
612612
}
613613

614-
iterator! { impl Entries -> (uint, &'a V), as_ref }
615-
double_ended_iterator! { impl Entries -> (uint, &'a V), as_ref }
614+
iterator! { impl Iter -> (uint, &'a V), as_ref }
615+
double_ended_iterator! { impl Iter -> (uint, &'a V), as_ref }
616616

617617
/// An iterator over the key-value pairs of a map, with the
618618
/// values being mutable.
619-
pub struct MutEntries<'a, V:'a> {
619+
pub struct IterMut<'a, V:'a> {
620620
front: uint,
621621
back: uint,
622622
iter: slice::IterMut<'a, Option<V>>
623623
}
624624

625-
iterator! { impl MutEntries -> (uint, &'a mut V), as_mut }
626-
double_ended_iterator! { impl MutEntries -> (uint, &'a mut V), as_mut }
625+
iterator! { impl IterMut -> (uint, &'a mut V), as_mut }
626+
double_ended_iterator! { impl IterMut -> (uint, &'a mut V), as_mut }
627627

628628
/// An iterator over the keys of a map.
629629
pub struct Keys<'a, V: 'a> {
630-
iter: Map<(uint, &'a V), uint, Entries<'a, V>, fn((uint, &'a V)) -> uint>
630+
iter: Map<(uint, &'a V), uint, Iter<'a, V>, fn((uint, &'a V)) -> uint>
631631
}
632632

633633
/// An iterator over the values of a map.
634634
pub struct Values<'a, V: 'a> {
635-
iter: Map<(uint, &'a V), &'a V, Entries<'a, V>, fn((uint, &'a V)) -> &'a V>
635+
iter: Map<(uint, &'a V), &'a V, Iter<'a, V>, fn((uint, &'a V)) -> &'a V>
636636
}
637637

638638
/// A consuming iterator over the key-value pairs of a map.

src/libcore/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ iterator!{struct Iter -> *const T, &'a T}
781781
#[experimental = "needs review"]
782782
impl<'a, T> ExactSizeIterator<&'a T> for Iter<'a, T> {}
783783

784-
#[experimental = "needs review"]
784+
#[stable]
785785
impl<'a, T> Clone for Iter<'a, T> {
786786
fn clone(&self) -> Iter<'a, T> { *self }
787787
}

0 commit comments

Comments
 (0)