diff options
| author | bors <bors@rust-lang.org> | 2013-07-27 16:37:27 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-27 16:37:27 -0700 |
| commit | b027c5fce3e74dfa5583224967e38ef40518ecfb (patch) | |
| tree | 5cad2e4790c731ec1a825154612ef40c54ff4ae9 /src/libextra | |
| parent | 098106870e0ebdebb40964624185f304ee7b3d63 (diff) | |
| parent | fe955e7b062f8787f9df7e9c36abc1b83485fead (diff) | |
| download | rust-b027c5fce3e74dfa5583224967e38ef40518ecfb.tar.gz rust-b027c5fce3e74dfa5583224967e38ef40518ecfb.zip | |
auto merge of #8074 : thestinger/rust/iterator, r=cmr
d7c9bb4 r=alexcrichton 7ae17e0 r=huonw
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/dlist.rs | 7 | ||||
| -rw-r--r-- | src/libextra/ringbuf.rs | 4 | ||||
| -rw-r--r-- | src/libextra/smallintmap.rs | 8 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 77060c4b11e..3cd2d91459f 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -356,7 +356,7 @@ impl<T> DList<T> { /// Provide a reverse iterator #[inline] - pub fn rev_iter<'a>(&'a self) -> InvertIterator<&'a T, DListIterator<'a, T>> { + pub fn rev_iter<'a>(&'a self) -> InvertIterator<DListIterator<'a, T>> { self.iter().invert() } @@ -376,8 +376,7 @@ impl<T> DList<T> { } /// Provide a reverse iterator with mutable references #[inline] - pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<&'a mut T, - MutDListIterator<'a, T>> { + pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<MutDListIterator<'a, T>> { self.mut_iter().invert() } @@ -390,7 +389,7 @@ impl<T> DList<T> { /// Consume the list into an iterator yielding elements by value, in reverse #[inline] - pub fn consume_rev_iter(self) -> InvertIterator<T, ConsumeIterator<T>> { + pub fn consume_rev_iter(self) -> InvertIterator<ConsumeIterator<T>> { self.consume_iter().invert() } } diff --git a/src/libextra/ringbuf.rs b/src/libextra/ringbuf.rs index aa670ec5ff8..334bf8f351f 100644 --- a/src/libextra/ringbuf.rs +++ b/src/libextra/ringbuf.rs @@ -181,7 +181,7 @@ impl<T> RingBuf<T> { } /// Back-to-front iterator. - pub fn rev_iter<'a>(&'a self) -> InvertIterator<&'a T, RingBufIterator<'a, T>> { + pub fn rev_iter<'a>(&'a self) -> InvertIterator<RingBufIterator<'a, T>> { self.iter().invert() } @@ -192,7 +192,7 @@ impl<T> RingBuf<T> { } /// Back-to-front iterator which returns mutable values. - pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<&'a mut T, RingBufMutIterator<'a, T>> { + pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<RingBufMutIterator<'a, T>> { self.mut_iter().invert() } } diff --git a/src/libextra/smallintmap.rs b/src/libextra/smallintmap.rs index bf6f80534b4..3c8d289b8b4 100644 --- a/src/libextra/smallintmap.rs +++ b/src/libextra/smallintmap.rs @@ -204,7 +204,7 @@ impl<V> SmallIntMap<V> { /// Empties the hash map, moving all values into the specified closure pub fn consume(&mut self) -> FilterMapIterator<(uint, Option<V>), (uint, V), - EnumerateIterator<Option<V>, VecConsumeIterator<Option<V>>>> + EnumerateIterator<VecConsumeIterator<Option<V>>>> { let values = replace(&mut self.v, ~[]); values.consume_iter().enumerate().filter_map(|(i, v)| { @@ -290,8 +290,7 @@ pub struct SmallIntMapIterator<'self, T> { iterator!(impl SmallIntMapIterator -> (uint, &'self T), get_ref) double_ended_iterator!(impl SmallIntMapIterator -> (uint, &'self T), get_ref) -pub type SmallIntMapRevIterator<'self, T> = InvertIterator<(uint, &'self T), - SmallIntMapIterator<'self, T>>; +pub type SmallIntMapRevIterator<'self, T> = InvertIterator<SmallIntMapIterator<'self, T>>; pub struct SmallIntMapMutIterator<'self, T> { priv front: uint, @@ -301,8 +300,7 @@ pub struct SmallIntMapMutIterator<'self, T> { iterator!(impl SmallIntMapMutIterator -> (uint, &'self mut T), get_mut_ref) double_ended_iterator!(impl SmallIntMapMutIterator -> (uint, &'self mut T), get_mut_ref) -pub type SmallIntMapMutRevIterator<'self, T> = InvertIterator<(uint, &'self mut T), - SmallIntMapMutIterator<'self, T>>; +pub type SmallIntMapMutRevIterator<'self, T> = InvertIterator<SmallIntMapMutIterator<'self, T>>; #[cfg(test)] mod test_map { |
