Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Rename Iterator adaptor types to drop the -Iterator suffix #8090

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libextra/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/libextra/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
}

Expand All @@ -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()
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/libextra/smallintmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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)| {
Expand Down Expand Up @@ -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,
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
use clone::Clone;
use cmp::{Eq, Equiv};
use hash::Hash;
use iterator::{Iterator, IteratorUtil, FromIterator, ChainIterator};
use iterator::{Iterator, IteratorUtil, FromIterator, Chain};
use num;
use option::{None, Option, Some};
use rand::RngUtil;
Expand Down Expand Up @@ -751,7 +751,7 @@ impl<T:Hash + Eq> HashSet<T> {

/// Visit the values representing the symmetric difference
pub fn symmetric_difference_iter<'a>(&'a self, other: &'a HashSet<T>)
-> ChainIterator<SetAlgebraIter<'a, T>, SetAlgebraIter<'a, T>> {
-> Chain<SetAlgebraIter<'a, T>, SetAlgebraIter<'a, T>> {
self.difference_iter(other).chain_(other.difference_iter(self))
}

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

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

Expand Down
Loading