diff options
| author | blake2-ppc <blake2-ppc> | 2013-07-27 23:41:20 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-07-29 04:20:56 +0200 |
| commit | 4b45f478818386cfe8554e3a5595c2cf38541b45 (patch) | |
| tree | 78436ab76d1ee1eff730dcc0eab06f0fee0c36a0 /src/libextra | |
| parent | 52dbe138cfd462f443fe209bcab12de418786e45 (diff) | |
std: Rename Iterator adaptor types to drop the -Iterator suffix
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/dlist.rs | 8 | ||||
| -rw-r--r-- | src/libextra/ringbuf.rs | 6 | ||||
| -rw-r--r-- | src/libextra/smallintmap.rs | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 3cd2d91459f..b8ba7e58f2a 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -25,7 +25,7 @@ use std::cast; use std::ptr; use std::util; -use std::iterator::{FromIterator, InvertIterator}; +use std::iterator::{FromIterator, Invert}; use container::Deque; @@ -356,7 +356,7 @@ impl<T> DList<T> { /// Provide a reverse iterator #[inline] - pub fn rev_iter<'a>(&'a self) -> InvertIterator<DListIterator<'a, T>> { + pub fn rev_iter<'a>(&'a self) -> Invert<DListIterator<'a, T>> { self.iter().invert() } @@ -376,7 +376,7 @@ impl<T> DList<T> { } /// Provide a reverse iterator with mutable references #[inline] - pub fn mut_rev_iter<'a>(&'a mut self) -> InvertIterator<MutDListIterator<'a, T>> { + pub fn mut_rev_iter<'a>(&'a mut self) -> Invert<MutDListIterator<'a, T>> { self.mut_iter().invert() } @@ -389,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<ConsumeIterator<T>> { + pub fn consume_rev_iter(self) -> Invert<ConsumeIterator<T>> { self.consume_iter().invert() } } diff --git a/src/libextra/ringbuf.rs b/src/libextra/ringbuf.rs index 334bf8f351f..200a409f63c 100644 --- a/src/libextra/ringbuf.rs +++ b/src/libextra/ringbuf.rs @@ -16,7 +16,7 @@ use std::num; use std::uint; use std::vec; -use std::iterator::{FromIterator, InvertIterator}; +use std::iterator::{FromIterator, Invert}; use container::Deque; @@ -181,7 +181,7 @@ impl<T> RingBuf<T> { } /// Back-to-front iterator. - pub fn rev_iter<'a>(&'a self) -> InvertIterator<RingBufIterator<'a, T>> { + pub fn rev_iter<'a>(&'a self) -> Invert<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<RingBufMutIterator<'a, T>> { + pub fn mut_rev_iter<'a>(&'a mut self) -> Invert<RingBufMutIterator<'a, T>> { self.mut_iter().invert() } } diff --git a/src/libextra/smallintmap.rs b/src/libextra/smallintmap.rs index 92a120592ff..11b093dd884 100644 --- a/src/libextra/smallintmap.rs +++ b/src/libextra/smallintmap.rs @@ -15,7 +15,7 @@ #[allow(missing_doc)]; -use std::iterator::{Iterator, IteratorUtil, EnumerateIterator, FilterMapIterator, InvertIterator}; +use std::iterator::{Iterator, IteratorUtil, Enumerate, FilterMap, Invert}; use std::uint; use std::util::replace; use std::vec::{VecIterator, VecMutIterator}; @@ -204,8 +204,8 @@ 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<vec::ConsumeIterator<Option<V>>>> + -> FilterMap<(uint, Option<V>), (uint, V), + Enumerate<vec::ConsumeIterator<Option<V>>>> { let values = replace(&mut self.v, ~[]); values.consume_iter().enumerate().filter_map(|(i, v)| { @@ -291,7 +291,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<SmallIntMapIterator<'self, T>>; +pub type SmallIntMapRevIterator<'self, T> = Invert<SmallIntMapIterator<'self, T>>; pub struct SmallIntMapMutIterator<'self, T> { priv front: uint, @@ -301,7 +301,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<SmallIntMapMutIterator<'self, T>>; +pub type SmallIntMapMutRevIterator<'self, T> = Invert<SmallIntMapMutIterator<'self, T>>; #[cfg(test)] mod test_map { |
