Skip to content

Commit b027c5f

Browse files
committed
auto merge of #8074 : thestinger/rust/iterator, r=cmr
d7c9bb4 r=alexcrichton 7ae17e0 r=huonw
2 parents 0981068 + fe955e7 commit b027c5f

File tree

6 files changed

+106
-77
lines changed

6 files changed

+106
-77
lines changed

src/libextra/dlist.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl<T> DList<T> {
356356

357357
/// Provide a reverse iterator
358358
#[inline]
359-
pub fn rev_iter<'a>(&'a self) -> InvertIterator<&'a T, DListIterator<'a, T>> {
359+
pub fn rev_iter<'a>(&'a self) -> InvertIterator<DListIterator<'a, T>> {
360360
self.iter().invert()
361361
}
362362

@@ -376,8 +376,7 @@ impl<T> DList<T> {
376376
}
377377
/// Provide a reverse iterator with mutable references
378378
#[inline]
379-
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<&'a mut T,
380-
MutDListIterator<'a, T>> {
379+
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<MutDListIterator<'a, T>> {
381380
self.mut_iter().invert()
382381
}
383382

@@ -390,7 +389,7 @@ impl<T> DList<T> {
390389

391390
/// Consume the list into an iterator yielding elements by value, in reverse
392391
#[inline]
393-
pub fn consume_rev_iter(self) -> InvertIterator<T, ConsumeIterator<T>> {
392+
pub fn consume_rev_iter(self) -> InvertIterator<ConsumeIterator<T>> {
394393
self.consume_iter().invert()
395394
}
396395
}

src/libextra/ringbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<T> RingBuf<T> {
181181
}
182182

183183
/// Back-to-front iterator.
184-
pub fn rev_iter<'a>(&'a self) -> InvertIterator<&'a T, RingBufIterator<'a, T>> {
184+
pub fn rev_iter<'a>(&'a self) -> InvertIterator<RingBufIterator<'a, T>> {
185185
self.iter().invert()
186186
}
187187

@@ -192,7 +192,7 @@ impl<T> RingBuf<T> {
192192
}
193193

194194
/// Back-to-front iterator which returns mutable values.
195-
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<&'a mut T, RingBufMutIterator<'a, T>> {
195+
pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<RingBufMutIterator<'a, T>> {
196196
self.mut_iter().invert()
197197
}
198198
}

src/libextra/smallintmap.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<V> SmallIntMap<V> {
204204
/// Empties the hash map, moving all values into the specified closure
205205
pub fn consume(&mut self)
206206
-> FilterMapIterator<(uint, Option<V>), (uint, V),
207-
EnumerateIterator<Option<V>, VecConsumeIterator<Option<V>>>>
207+
EnumerateIterator<VecConsumeIterator<Option<V>>>>
208208
{
209209
let values = replace(&mut self.v, ~[]);
210210
values.consume_iter().enumerate().filter_map(|(i, v)| {
@@ -290,8 +290,7 @@ pub struct SmallIntMapIterator<'self, T> {
290290

291291
iterator!(impl SmallIntMapIterator -> (uint, &'self T), get_ref)
292292
double_ended_iterator!(impl SmallIntMapIterator -> (uint, &'self T), get_ref)
293-
pub type SmallIntMapRevIterator<'self, T> = InvertIterator<(uint, &'self T),
294-
SmallIntMapIterator<'self, T>>;
293+
pub type SmallIntMapRevIterator<'self, T> = InvertIterator<SmallIntMapIterator<'self, T>>;
295294

296295
pub struct SmallIntMapMutIterator<'self, T> {
297296
priv front: uint,
@@ -301,8 +300,7 @@ pub struct SmallIntMapMutIterator<'self, T> {
301300

302301
iterator!(impl SmallIntMapMutIterator -> (uint, &'self mut T), get_mut_ref)
303302
double_ended_iterator!(impl SmallIntMapMutIterator -> (uint, &'self mut T), get_mut_ref)
304-
pub type SmallIntMapMutRevIterator<'self, T> = InvertIterator<(uint, &'self mut T),
305-
SmallIntMapMutIterator<'self, T>>;
303+
pub type SmallIntMapMutRevIterator<'self, T> = InvertIterator<SmallIntMapMutIterator<'self, T>>;
306304

307305
#[cfg(test)]
308306
mod test_map {

src/libstd/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ impl<T:Hash + Eq> HashSet<T> {
751751

752752
/// Visit the values representing the symmetric difference
753753
pub fn symmetric_difference_iter<'a>(&'a self, other: &'a HashSet<T>)
754-
-> ChainIterator<&'a T, SetAlgebraIter<'a, T>, SetAlgebraIter<'a, T>> {
754+
-> ChainIterator<SetAlgebraIter<'a, T>, SetAlgebraIter<'a, T>> {
755755
self.difference_iter(other).chain_(other.difference_iter(self))
756756
}
757757

@@ -764,7 +764,7 @@ impl<T:Hash + Eq> HashSet<T> {
764764

765765
/// Visit the values representing the union
766766
pub fn union_iter<'a>(&'a self, other: &'a HashSet<T>)
767-
-> ChainIterator<&'a T, HashSetIterator<'a, T>, SetAlgebraIter<'a, T>> {
767+
-> ChainIterator<HashSetIterator<'a, T>, SetAlgebraIter<'a, T>> {
768768
self.iter().chain_(other.difference_iter(self))
769769
}
770770

0 commit comments

Comments
 (0)