1
Fork 0

rename std::iterator to std::iter

The trait will keep the `Iterator` naming, but a more concise module
name makes using the free functions less verbose. The module will define
iterables in addition to iterators, as it deals with iteration in
general.
This commit is contained in:
Daniel Micay 2013-09-08 11:01:16 -04:00
parent dd5c7379e9
commit 6919cf5fe1
48 changed files with 89 additions and 95 deletions

View file

@ -200,7 +200,7 @@ for i in range(0, 5) {
printf!("%d ", i) // prints "0 1 2 3 4" printf!("%d ", i) // prints "0 1 2 3 4"
} }
for i in std::iterator::range_inclusive(0, 5) { // needs explicit import for i in std::iter::range_inclusive(0, 5) { // needs explicit import
printf!("%d ", i) // prints "0 1 2 3 4 5" printf!("%d ", i) // prints "0 1 2 3 4 5"
} }
~~~ ~~~

View file

@ -310,7 +310,7 @@ def emit_decomp_module(f, canon, compat, combine):
+ " bsearch_range_value_table(c, combining_class_table)\n" + " bsearch_range_value_table(c, combining_class_table)\n"
+ " }\n\n") + " }\n\n")
f.write(" fn d(c: char, i: &fn(char), k: bool) {\n") f.write(" fn d(c: char, i: &fn(char), k: bool) {\n")
f.write(" use iterator::Iterator;\n"); f.write(" use iter::Iterator;\n");
f.write(" if c <= '\\x7f' { i(c); return; }\n") f.write(" if c <= '\\x7f' { i(c); return; }\n")

View file

@ -12,8 +12,8 @@
use std::cmp; use std::cmp;
use std::iterator::RandomAccessIterator; use std::iter::RandomAccessIterator;
use std::iterator::{Invert, Enumerate, Repeat, Map, Zip}; use std::iter::{Invert, Enumerate, Repeat, Map, Zip};
use std::num; use std::num;
use std::ops; use std::ops;
use std::uint; use std::uint;

View file

@ -25,8 +25,8 @@
use std::cast; use std::cast;
use std::ptr; use std::ptr;
use std::util; use std::util;
use std::iterator::{FromIterator, Extendable, Invert}; use std::iter::Invert;
use std::iterator; use std::iter;
use container::Deque; use container::Deque;
@ -593,27 +593,27 @@ impl<A> Extendable<A> for DList<A> {
impl<A: Eq> Eq for DList<A> { impl<A: Eq> Eq for DList<A> {
fn eq(&self, other: &DList<A>) -> bool { fn eq(&self, other: &DList<A>) -> bool {
self.len() == other.len() && self.len() == other.len() &&
iterator::order::eq(self.iter(), other.iter()) iter::order::eq(self.iter(), other.iter())
} }
fn ne(&self, other: &DList<A>) -> bool { fn ne(&self, other: &DList<A>) -> bool {
self.len() != other.len() || self.len() != other.len() ||
iterator::order::ne(self.iter(), other.iter()) iter::order::ne(self.iter(), other.iter())
} }
} }
impl<A: Eq + Ord> Ord for DList<A> { impl<A: Eq + Ord> Ord for DList<A> {
fn lt(&self, other: &DList<A>) -> bool { fn lt(&self, other: &DList<A>) -> bool {
iterator::order::lt(self.iter(), other.iter()) iter::order::lt(self.iter(), other.iter())
} }
fn le(&self, other: &DList<A>) -> bool { fn le(&self, other: &DList<A>) -> bool {
iterator::order::le(self.iter(), other.iter()) iter::order::le(self.iter(), other.iter())
} }
fn gt(&self, other: &DList<A>) -> bool { fn gt(&self, other: &DList<A>) -> bool {
iterator::order::gt(self.iter(), other.iter()) iter::order::gt(self.iter(), other.iter())
} }
fn ge(&self, other: &DList<A>) -> bool { fn ge(&self, other: &DList<A>) -> bool {
iterator::order::ge(self.iter(), other.iter()) iter::order::ge(self.iter(), other.iter())
} }
} }

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use std::iterator::Iterator;
#[deriving(Clone, Eq, IterBytes, ToStr)] #[deriving(Clone, Eq, IterBytes, ToStr)]
/// A specialized Set implementation to use enum types. /// A specialized Set implementation to use enum types.
pub struct EnumSet<E> { pub struct EnumSet<E> {

View file

@ -18,7 +18,6 @@
use std::char; use std::char;
use std::cast::transmute; use std::cast::transmute;
use std::iterator;
use std::float; use std::float;
use std::hashmap::HashMap; use std::hashmap::HashMap;
use std::io::WriterUtil; use std::io::WriterUtil;
@ -489,7 +488,7 @@ pub struct Parser<T> {
} }
/// Decode a json value from an Iterator<char> /// Decode a json value from an Iterator<char>
pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> { pub fn Parser<T : Iterator<char>>(rdr: ~T) -> Parser<T> {
let mut p = Parser { let mut p = Parser {
rdr: rdr, rdr: rdr,
ch: '\x00', ch: '\x00',
@ -500,7 +499,7 @@ pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> {
p p
} }
impl<T: iterator::Iterator<char>> Parser<T> { impl<T: Iterator<char>> Parser<T> {
pub fn parse(&mut self) -> Result<Json, Error> { pub fn parse(&mut self) -> Result<Json, Error> {
match self.parse_value() { match self.parse_value() {
Ok(value) => { Ok(value) => {
@ -518,7 +517,7 @@ impl<T: iterator::Iterator<char>> Parser<T> {
} }
} }
impl<T : iterator::Iterator<char>> Parser<T> { impl<T : Iterator<char>> Parser<T> {
// FIXME: #8971: unsound // FIXME: #8971: unsound
fn eof(&self) -> bool { self.ch == unsafe { transmute(-1u32) } } fn eof(&self) -> bool { self.ch == unsafe { transmute(-1u32) } }

View file

@ -2011,13 +2011,13 @@ mod bigint_tests {
#[cfg(test)] #[cfg(test)]
mod bench { mod bench {
use super::*; use super::*;
use std::{iterator, util}; use std::{iter, util};
use std::num::{Zero, One}; use std::num::{Zero, One};
use extra::test::BenchHarness; use extra::test::BenchHarness;
fn factorial(n: uint) -> BigUint { fn factorial(n: uint) -> BigUint {
let mut f: BigUint = One::one(); let mut f: BigUint = One::one();
for i in iterator::range_inclusive(1, n) { for i in iter::range_inclusive(1, n) {
f = f * BigUint::from_uint(i); f = f * BigUint::from_uint(i);
} }
f f

View file

@ -16,7 +16,6 @@ use std::clone::Clone;
use std::unstable::intrinsics::{move_val_init, init}; use std::unstable::intrinsics::{move_val_init, init};
use std::util::{replace, swap}; use std::util::{replace, swap};
use std::vec; use std::vec;
use std::iterator::{FromIterator, Extendable};
/// A priority queue implemented with a binary heap /// A priority queue implemented with a binary heap
#[deriving(Clone)] #[deriving(Clone)]

View file

@ -15,7 +15,7 @@
use std::num; use std::num;
use std::vec; use std::vec;
use std::iterator::{FromIterator, Invert, RandomAccessIterator, Extendable}; use std::iter::{Invert, RandomAccessIterator};
use container::Deque; use container::Deque;
@ -694,13 +694,13 @@ mod tests {
#[test] #[test]
fn test_from_iterator() { fn test_from_iterator() {
use std::iterator; use std::iter;
let v = ~[1,2,3,4,5,6,7]; let v = ~[1,2,3,4,5,6,7];
let deq: RingBuf<int> = v.iter().map(|&x| x).collect(); let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
let u: ~[int] = deq.iter().map(|&x| x).collect(); let u: ~[int] = deq.iter().map(|&x| x).collect();
assert_eq!(u, v); assert_eq!(u, v);
let mut seq = iterator::count(0u, 2).take(256); let mut seq = iter::count(0u, 2).take(256);
let deq: RingBuf<uint> = seq.collect(); let deq: RingBuf<uint> = seq.collect();
for (i, &x) in deq.iter().enumerate() { for (i, &x) in deq.iter().enumerate() {
assert_eq!(2*i, x); assert_eq!(2*i, x);

View file

@ -15,7 +15,7 @@
#[allow(missing_doc)]; #[allow(missing_doc)];
use std::iterator::{Iterator, Enumerate, FilterMap, Invert}; use std::iter::{Enumerate, FilterMap, Invert};
use std::util::replace; use std::util::replace;
use std::vec::{VecIterator, VecMutIterator}; use std::vec::{VecIterator, VecMutIterator};
use std::vec; use std::vec;

View file

@ -14,7 +14,7 @@
use std::util::{swap, replace}; use std::util::{swap, replace};
use std::iterator::{FromIterator, Extendable, Peekable}; use std::iter::{Peekable};
use std::cmp::Ordering; use std::cmp::Ordering;
// This is implemented as an AA tree, which is a simplified variation of // This is implemented as an AA tree, which is a simplified variation of

View file

@ -18,7 +18,7 @@ use middle::typeck::method_map;
use middle::moves; use middle::moves;
use util::ppaux::ty_to_str; use util::ppaux::ty_to_str;
use std::iterator; use std::iter;
use std::num; use std::num;
use std::vec; use std::vec;
use extra::sort; use extra::sort;
@ -282,7 +282,7 @@ pub fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
_ => max_len _ => max_len
} }
}; };
for n in iterator::range(0u, max_len + 1) { for n in iter::range(0u, max_len + 1) {
match is_useful_specialized(cx, m, v, vec(n), n, left_ty) { match is_useful_specialized(cx, m, v, vec(n), n, left_ty) {
not_useful => (), not_useful => (),
ref u => return *u, ref u => return *u,

View file

@ -10,7 +10,7 @@
use lib::llvm::{llvm, BasicBlockRef}; use lib::llvm::{llvm, BasicBlockRef};
use middle::trans::value::{UserIterator, Value}; use middle::trans::value::{UserIterator, Value};
use std::iterator::{Filter, Map}; use std::iter::{Filter, Map};
pub struct BasicBlock(BasicBlockRef); pub struct BasicBlock(BasicBlockRef);

View file

@ -12,7 +12,7 @@
use clone::Clone; use clone::Clone;
use container::Container; use container::Container;
use iterator::Iterator; use iter::Iterator;
use option::{Option, Some, None}; use option::{Option, Some, None};
use sys; use sys;
use unstable::raw::Repr; use unstable::raw::Repr;

View file

@ -9,14 +9,14 @@
// except according to those terms. // except according to those terms.
use cast; use cast;
use iterator::{Iterator,range}; use iter::{Iterator, range};
use libc; use libc;
use ops::Drop; use ops::Drop;
use option::{Option, Some, None}; use option::{Option, Some, None};
use ptr::RawPtr; use ptr::RawPtr;
use ptr; use ptr;
use str::StrSlice; use str::StrSlice;
use vec::{ImmutableVector,CopyableVector}; use vec::{ImmutableVector, CopyableVector};
use container::Container; use container::Container;
/// Resolution options for the `null_byte` condition /// Resolution options for the `null_byte` condition

View file

@ -16,7 +16,7 @@ use option::{Some, None};
use clone::Clone; use clone::Clone;
use container::Container; use container::Container;
use cmp::Eq; use cmp::Eq;
use iterator::{Iterator, FilterMap}; use iter::{Iterator, FilterMap};
use result::Result; use result::Result;
use result; use result;
use str::StrSlice; use str::StrSlice;

View file

@ -812,7 +812,7 @@ macro_rules! upper_hex(($ty:ident, $into:ident) => {
#[doc(hidden)] #[doc(hidden)]
pub fn upperhex(buf: &[u8], f: &mut Formatter) { pub fn upperhex(buf: &[u8], f: &mut Formatter) {
let mut local = [0u8, ..16]; let mut local = [0u8, ..16];
for i in ::iterator::range(0, buf.len()) { for i in ::iter::range(0, buf.len()) {
local[i] = match buf[i] as char { local[i] = match buf[i] as char {
'a' .. 'f' => (buf[i] - 'a' as u8) + 'A' as u8, 'a' .. 'f' => (buf[i] - 'a' as u8) + 'A' as u8,
c => c as u8, c => c as u8,

View file

@ -12,7 +12,6 @@ use prelude::*;
use char; use char;
use str; use str;
use iterator;
condition! { pub parse_error: ~str -> (); } condition! { pub parse_error: ~str -> (); }
@ -152,7 +151,7 @@ pub struct Parser<'self> {
priv depth: uint, priv depth: uint,
} }
impl<'self> iterator::Iterator<Piece<'self>> for Parser<'self> { impl<'self> Iterator<Piece<'self>> for Parser<'self> {
fn next(&mut self) -> Option<Piece<'self>> { fn next(&mut self) -> Option<Piece<'self>> {
match self.cur.clone().next() { match self.cur.clone().next() {
Some((_, '#')) => { self.cur.next(); Some(CurrentArgument) } Some((_, '#')) => { self.cur.next(); Some(CurrentArgument) }

View file

@ -22,7 +22,7 @@
#[allow(missing_doc)]; #[allow(missing_doc)];
use container::Container; use container::Container;
use iterator::Iterator; use iter::Iterator;
use option::{Some, None}; use option::{Some, None};
use rt::io::Writer; use rt::io::Writer;
use str::OwnedStr; use str::OwnedStr;

View file

@ -19,8 +19,8 @@ use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
use clone::Clone; use clone::Clone;
use cmp::{Eq, Equiv}; use cmp::{Eq, Equiv};
use hash::Hash; use hash::Hash;
use iterator::{Iterator, FromIterator, Extendable}; use iter::{Iterator, FromIterator, Extendable};
use iterator::{FilterMap, Chain, Repeat, Zip}; use iter::{FilterMap, Chain, Repeat, Zip};
use num; use num;
use option::{None, Option, Some}; use option::{None, Option, Some};
use rand::RngUtil; use rand::RngUtil;

View file

@ -52,7 +52,7 @@ use clone::Clone;
use c_str::ToCStr; use c_str::ToCStr;
use container::Container; use container::Container;
use int; use int;
use iterator::Iterator; use iter::Iterator;
use libc::consts::os::posix88::*; use libc::consts::os::posix88::*;
use libc::{c_int, c_void, size_t}; use libc::{c_int, c_void, size_t};
use libc; use libc;

View file

@ -363,7 +363,7 @@ pub trait Iterator<A> {
/// # Example /// # Example
/// ///
/// ~~~ {.rust} /// ~~~ {.rust}
/// use std::iterator::Counter; /// use std::iter::count;
/// ///
/// for i in count(0, 10) { /// for i in count(0, 10) {
/// printfln!("%d", i); /// printfln!("%d", i);
@ -754,7 +754,7 @@ pub trait MultiplicativeIterator<A> {
/// # Example /// # Example
/// ///
/// ~~~ {.rust} /// ~~~ {.rust}
/// use std::iterator::Counter; /// use std::iter::count;
/// ///
/// fn factorial(n: uint) -> uint { /// fn factorial(n: uint) -> uint {
/// count(1u, 1).take_while(|&i| i <= n).product() /// count(1u, 1).take_while(|&i| i <= n).product()

View file

@ -45,8 +45,8 @@ use clone::Clone;
use cmp::{Eq,Ord}; use cmp::{Eq,Ord};
use util; use util;
use num::Zero; use num::Zero;
use iterator; use iter;
use iterator::{Iterator, DoubleEndedIterator, ExactSize}; use iter::{Iterator, DoubleEndedIterator, ExactSize};
use str::{StrSlice, OwnedStr}; use str::{StrSlice, OwnedStr};
use to_str::ToStr; use to_str::ToStr;
use clone::DeepClone; use clone::DeepClone;
@ -60,19 +60,19 @@ pub enum Option<T> {
impl<T: Eq + Ord> Ord for Option<T> { impl<T: Eq + Ord> Ord for Option<T> {
fn lt(&self, other: &Option<T>) -> bool { fn lt(&self, other: &Option<T>) -> bool {
iterator::order::lt(self.iter(), other.iter()) iter::order::lt(self.iter(), other.iter())
} }
fn le(&self, other: &Option<T>) -> bool { fn le(&self, other: &Option<T>) -> bool {
iterator::order::le(self.iter(), other.iter()) iter::order::le(self.iter(), other.iter())
} }
fn ge(&self, other: &Option<T>) -> bool { fn ge(&self, other: &Option<T>) -> bool {
iterator::order::ge(self.iter(), other.iter()) iter::order::ge(self.iter(), other.iter())
} }
fn gt(&self, other: &Option<T>) -> bool { fn gt(&self, other: &Option<T>) -> bool {
iterator::order::gt(self.iter(), other.iter()) iter::order::gt(self.iter(), other.iter())
} }
} }

View file

@ -32,7 +32,7 @@ use c_str::ToCStr;
use clone::Clone; use clone::Clone;
use container::Container; use container::Container;
use io; use io;
use iterator::range; use iter::range;
use libc; use libc;
use libc::{c_char, c_void, c_int, size_t}; use libc::{c_char, c_void, c_int, size_t};
use libc::FILE; use libc::FILE;

View file

@ -21,7 +21,7 @@ use c_str;
use clone::Clone; use clone::Clone;
use cmp::Eq; use cmp::Eq;
use container::Container; use container::Container;
use iterator::{Iterator, range}; use iter::{Iterator, range};
use libc; use libc;
use num; use num;
use option::{None, Option, Some}; use option::{None, Option, Some};

View file

@ -40,7 +40,7 @@ pub use result::{Result, Ok, Err};
// Reexported functions // Reexported functions
pub use io::{print, println}; pub use io::{print, println};
pub use iterator::range; pub use iter::range;
pub use from_str::from_str; pub use from_str::from_str;
// Reexported types and traits // Reexported types and traits
@ -51,9 +51,9 @@ pub use char::Char;
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet}; pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
pub use hash::Hash; pub use hash::Hash;
pub use num::Times; pub use num::Times;
pub use iterator::{FromIterator, Extendable}; pub use iter::{FromIterator, Extendable};
pub use iterator::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator}; pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator};
pub use iterator::{OrdIterator, MutableDoubleEndedIterator, ExactSize}; pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul}; pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
pub use num::{Orderable, Signed, Unsigned, Round}; pub use num::{Orderable, Signed, Unsigned, Round};
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic}; pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};

View file

@ -14,7 +14,7 @@ use cast;
use clone::Clone; use clone::Clone;
#[cfg(not(test))] #[cfg(not(test))]
use cmp::Equiv; use cmp::Equiv;
use iterator::{range, Iterator}; use iter::{range, Iterator};
use option::{Option, Some, None}; use option::{Option, Some, None};
#[cfg(stage0)] #[cfg(stage0)]
use sys; use sys;

View file

@ -48,7 +48,7 @@ use clone::Clone;
use cmp; use cmp;
use container::Container; use container::Container;
use int; use int;
use iterator::{Iterator, range}; use iter::{Iterator, range};
use local_data; use local_data;
use num; use num;
use prelude::*; use prelude::*;
@ -957,7 +957,7 @@ pub fn random<T: Rand>() -> T {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use iterator::{Iterator, range}; use iter::{Iterator, range};
use option::{Option, Some}; use option::{Option, Some};
use super::*; use super::*;

View file

@ -20,7 +20,7 @@ use cast::transmute;
use char; use char;
use container::Container; use container::Container;
use rt::io; use rt::io;
use iterator::Iterator; use iter::Iterator;
use libc::c_void; use libc::c_void;
use option::{Some, None}; use option::{Some, None};
use ptr; use ptr;

View file

@ -20,7 +20,7 @@ use cast::transmute;
use char; use char;
use container::Container; use container::Container;
use io::{Writer, WriterUtil}; use io::{Writer, WriterUtil};
use iterator::Iterator; use iter::Iterator;
use libc::c_void; use libc::c_void;
use option::{Some, None}; use option::{Some, None};
use ptr; use ptr;

View file

@ -15,7 +15,7 @@
use clone::Clone; use clone::Clone;
use cmp::Eq; use cmp::Eq;
use either; use either;
use iterator::Iterator; use iter::Iterator;
use option::{None, Option, Some, OptionIterator}; use option::{None, Option, Some, OptionIterator};
use vec; use vec;
use vec::OwnedVector; use vec::OwnedVector;
@ -335,7 +335,7 @@ mod tests {
use super::*; use super::*;
use either; use either;
use iterator::range; use iter::range;
use str::OwnedStr; use str::OwnedStr;
use vec::ImmutableVector; use vec::ImmutableVector;

View file

@ -55,7 +55,7 @@ pub fn clone() -> Option<~[~str]> {
mod imp { mod imp {
use libc; use libc;
use option::{Option, Some, None}; use option::{Option, Some, None};
use iterator::Iterator; use iter::Iterator;
use str; use str;
use unstable::finally::Finally; use unstable::finally::Finally;
use util; use util;

View file

@ -15,7 +15,7 @@
use uint; use uint;
use int; use int;
use iterator::Iterator; use iter::Iterator;
use vec; use vec;
use rt::io::{Reader, Writer, Decorator}; use rt::io::{Reader, Writer, Decorator};
use rt::io::{read_error, standard_error, EndOfFile, DEFAULT_BUF_SIZE}; use rt::io::{read_error, standard_error, EndOfFile, DEFAULT_BUF_SIZE};

View file

@ -59,7 +59,7 @@ Several modules in `core` are clients of `rt`:
use cell::Cell; use cell::Cell;
use clone::Clone; use clone::Clone;
use container::Container; use container::Container;
use iterator::Iterator; use iter::Iterator;
use option::{Option, None, Some}; use option::{Option, None, Some};
use ptr::RawPtr; use ptr::RawPtr;
use rt::local::Local; use rt::local::Local;

View file

@ -27,7 +27,7 @@ use rt::rtio::{RemoteCallback, PausibleIdleCallback};
use borrow::{to_uint}; use borrow::{to_uint};
use cell::Cell; use cell::Cell;
use rand::{XorShiftRng, RngUtil}; use rand::{XorShiftRng, RngUtil};
use iterator::{range}; use iter::range;
use vec::{OwnedVector}; use vec::{OwnedVector};
/// A scheduler is responsible for coordinating the execution of Tasks /// A scheduler is responsible for coordinating the execution of Tasks

View file

@ -14,7 +14,7 @@ use option::{Some, None};
use cell::Cell; use cell::Cell;
use clone::Clone; use clone::Clone;
use container::Container; use container::Container;
use iterator::{Iterator, range}; use iter::{Iterator, range};
use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr}; use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
use vec::{OwnedVector, MutableVector, ImmutableVector}; use vec::{OwnedVector, MutableVector, ImmutableVector};
use rt::sched::Scheduler; use rt::sched::Scheduler;

View file

@ -44,7 +44,7 @@ use task;
#[cfg(test)] use rt::test::{spawntask, #[cfg(test)] use rt::test::{spawntask,
next_test_ip4, next_test_ip4,
run_in_newsched_task}; run_in_newsched_task};
#[cfg(test)] use iterator::{Iterator, range}; #[cfg(test)] use iter::{Iterator, range};
// XXX we should not be calling uvll functions in here. // XXX we should not be calling uvll functions in here.

View file

@ -11,7 +11,7 @@
use cell::Cell; use cell::Cell;
use comm; use comm;
use container::Container; use container::Container;
use iterator::{Iterator, DoubleEndedIterator}; use iter::{Iterator, DoubleEndedIterator};
use option::*; use option::*;
// use either::{Either, Left, Right}; // use either::{Either, Left, Right};
// use rt::kill::BlockedTask; // use rt::kill::BlockedTask;
@ -134,7 +134,7 @@ mod test {
use comm::GenericChan; use comm::GenericChan;
use task; use task;
use cell::Cell; use cell::Cell;
use iterator::{Iterator, range}; use iter::{Iterator, range};
#[test] #[should_fail] #[test] #[should_fail]
fn select_doesnt_get_trolled() { fn select_doesnt_get_trolled() {

View file

@ -140,7 +140,7 @@ pub mod borrow;
pub mod from_str; pub mod from_str;
#[path = "num/num.rs"] #[path = "num/num.rs"]
pub mod num; pub mod num;
pub mod iterator; pub mod iter;
pub mod to_str; pub mod to_str;
pub mod to_bytes; pub mod to_bytes;
pub mod clone; pub mod clone;

View file

@ -23,9 +23,9 @@ use char::Char;
use clone::{Clone, DeepClone}; use clone::{Clone, DeepClone};
use container::{Container, Mutable}; use container::{Container, Mutable};
use num::Times; use num::Times;
use iterator::{Iterator, FromIterator, Extendable}; use iter::{Iterator, FromIterator, Extendable};
use iterator::{Filter, AdditiveIterator, Map}; use iter::{Filter, AdditiveIterator, Map};
use iterator::{Invert, DoubleEndedIterator, ExactSize}; use iter::{Invert, DoubleEndedIterator, ExactSize};
use libc; use libc;
use num::{Saturating}; use num::{Saturating};
use option::{None, Option, Some}; use option::{None, Option, Some};
@ -592,7 +592,7 @@ impl<'self> Iterator<&'self str> for StrSplitIterator<'self> {
// Helper functions used for Unicode normalization // Helper functions used for Unicode normalization
fn canonical_sort(comb: &mut [(char, u8)]) { fn canonical_sort(comb: &mut [(char, u8)]) {
use iterator::range; use iter::range;
use tuple::CopyableTuple; use tuple::CopyableTuple;
let len = comb.len(); let len = comb.len();
@ -3325,7 +3325,7 @@ mod tests {
#[test] #[test]
fn test_iterator() { fn test_iterator() {
use iterator::*; use iter::*;
let s = ~"ศไทย中华Việt Nam"; let s = ~"ศไทย中华Việt Nam";
let v = ~['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m']; let v = ~['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
@ -3341,7 +3341,7 @@ mod tests {
#[test] #[test]
fn test_rev_iterator() { fn test_rev_iterator() {
use iterator::*; use iter::*;
let s = ~"ศไทย中华Việt Nam"; let s = ~"ศไทย中华Việt Nam";
let v = ~['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ']; let v = ~['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];
@ -3397,7 +3397,7 @@ mod tests {
#[test] #[test]
fn test_char_offset_iterator() { fn test_char_offset_iterator() {
use iterator::*; use iter::*;
let s = "ศไทย中华Việt Nam"; let s = "ศไทย中华Việt Nam";
let p = [0, 3, 6, 9, 12, 15, 18, 19, 20, 23, 24, 25, 26, 27]; let p = [0, 3, 6, 9, 12, 15, 18, 19, 20, 23, 24, 25, 26, 27];
let v = ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m']; let v = ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
@ -3415,7 +3415,7 @@ mod tests {
#[test] #[test]
fn test_char_offset_rev_iterator() { fn test_char_offset_rev_iterator() {
use iterator::*; use iter::*;
let s = "ศไทย中华Việt Nam"; let s = "ศไทย中华Việt Nam";
let p = [27, 26, 25, 24, 23, 20, 19, 18, 15, 12, 9, 6, 3, 0]; let p = [27, 26, 25, 24, 23, 20, 19, 18, 15, 12, 9, 6, 3, 0];
let v = ['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ']; let v = ['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];

View file

@ -17,7 +17,7 @@ use str::OwnedStr;
use container::Container; use container::Container;
use cast; use cast;
use ptr; use ptr;
use iterator::Iterator; use iter::Iterator;
use vec::{CopyableVector, ImmutableVector}; use vec::{CopyableVector, ImmutableVector};
use to_bytes::IterBytes; use to_bytes::IterBytes;
use option::{Some, None}; use option::{Some, None};

View file

@ -18,7 +18,7 @@ use cast;
use container::Container; use container::Container;
use io; use io;
use io::Writer; use io::Writer;
use iterator::Iterator; use iter::Iterator;
use option::{None, Option, Some}; use option::{None, Option, Some};
use str::{Str, StrSlice}; use str::{Str, StrSlice};
use vec::{Vector, ImmutableVector}; use vec::{Vector, ImmutableVector};

View file

@ -19,7 +19,7 @@ use str::OwnedStr;
use hashmap::HashMap; use hashmap::HashMap;
use hashmap::HashSet; use hashmap::HashSet;
use hash::Hash; use hash::Hash;
use iterator::Iterator; use iter::Iterator;
use cmp::Eq; use cmp::Eq;
use vec::ImmutableVector; use vec::ImmutableVector;

View file

@ -11,7 +11,6 @@
//! An ordered map and set for integer keys implemented as a radix trie //! An ordered map and set for integer keys implemented as a radix trie
use prelude::*; use prelude::*;
use iterator::{FromIterator, Extendable};
use uint; use uint;
use util::{swap, replace}; use util::{swap, replace};
use vec; use vec;

View file

@ -3628,7 +3628,7 @@ pub mod decompose {
} }
fn d(c: char, i: &fn(char), k: bool) { fn d(c: char, i: &fn(char), k: bool) {
use iterator::Iterator; use iter::Iterator;
if c <= '\x7f' { i(c); return; } if c <= '\x7f' { i(c); return; }
match bsearch_table(c, canonical_table) { match bsearch_table(c, canonical_table) {

View file

@ -63,7 +63,7 @@ use clone::{Clone, DeepClone};
use container::{Container, Mutable}; use container::{Container, Mutable};
use cmp::{Eq, TotalOrd, Ordering, Less, Equal, Greater}; use cmp::{Eq, TotalOrd, Ordering, Less, Equal, Greater};
use cmp; use cmp;
use iterator::*; use iter::*;
use libc::c_void; use libc::c_void;
use num::{Integer, Zero, CheckedAdd, Saturating}; use num::{Integer, Zero, CheckedAdd, Saturating};
use option::{None, Option, Some}; use option::{None, Option, Some};
@ -592,7 +592,7 @@ pub mod traits {
use clone::Clone; use clone::Clone;
use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Equiv}; use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Equiv};
use iterator::order; use iter::order;
use ops::Add; use ops::Add;
impl<'self,T:Eq> Eq for &'self [T] { impl<'self,T:Eq> Eq for &'self [T] {
@ -3241,7 +3241,7 @@ mod tests {
#[test] #[test]
fn test_iterator() { fn test_iterator() {
use iterator::*; use iter::*;
let xs = [1, 2, 5, 10, 11]; let xs = [1, 2, 5, 10, 11];
let mut it = xs.iter(); let mut it = xs.iter();
assert_eq!(it.size_hint(), (5, Some(5))); assert_eq!(it.size_hint(), (5, Some(5)));
@ -3260,7 +3260,7 @@ mod tests {
#[test] #[test]
fn test_random_access_iterator() { fn test_random_access_iterator() {
use iterator::*; use iter::*;
let xs = [1, 2, 5, 10, 11]; let xs = [1, 2, 5, 10, 11];
let mut it = xs.iter(); let mut it = xs.iter();
@ -3299,7 +3299,7 @@ mod tests {
#[test] #[test]
fn test_iter_size_hints() { fn test_iter_size_hints() {
use iterator::*; use iter::*;
let mut xs = [1, 2, 5, 10, 11]; let mut xs = [1, 2, 5, 10, 11];
assert_eq!(xs.iter().size_hint(), (5, Some(5))); assert_eq!(xs.iter().size_hint(), (5, Some(5)));
assert_eq!(xs.rev_iter().size_hint(), (5, Some(5))); assert_eq!(xs.rev_iter().size_hint(), (5, Some(5)));
@ -3320,7 +3320,7 @@ mod tests {
#[test] #[test]
fn test_mut_iterator() { fn test_mut_iterator() {
use iterator::*; use iter::*;
let mut xs = [1, 2, 3, 4, 5]; let mut xs = [1, 2, 3, 4, 5];
for x in xs.mut_iter() { for x in xs.mut_iter() {
*x += 1; *x += 1;
@ -3330,7 +3330,7 @@ mod tests {
#[test] #[test]
fn test_rev_iterator() { fn test_rev_iterator() {
use iterator::*; use iter::*;
let xs = [1, 2, 5, 10, 11]; let xs = [1, 2, 5, 10, 11];
let ys = [11, 10, 5, 2, 1]; let ys = [11, 10, 5, 2, 1];
@ -3344,7 +3344,7 @@ mod tests {
#[test] #[test]
fn test_mut_rev_iterator() { fn test_mut_rev_iterator() {
use iterator::*; use iter::*;
let mut xs = [1u, 2, 3, 4, 5]; let mut xs = [1u, 2, 3, 4, 5];
for (i,x) in xs.mut_rev_iter().enumerate() { for (i,x) in xs.mut_rev_iter().enumerate() {
*x += i; *x += i;
@ -3354,14 +3354,14 @@ mod tests {
#[test] #[test]
fn test_move_iterator() { fn test_move_iterator() {
use iterator::*; use iter::*;
let xs = ~[1u,2,3,4,5]; let xs = ~[1u,2,3,4,5];
assert_eq!(xs.move_iter().fold(0, |a: uint, b: uint| 10*a + b), 12345); assert_eq!(xs.move_iter().fold(0, |a: uint, b: uint| 10*a + b), 12345);
} }
#[test] #[test]
fn test_move_rev_iterator() { fn test_move_rev_iterator() {
use iterator::*; use iter::*;
let xs = ~[1u,2,3,4,5]; let xs = ~[1u,2,3,4,5];
assert_eq!(xs.move_rev_iter().fold(0, |a: uint, b: uint| 10*a + b), 54321); assert_eq!(xs.move_rev_iter().fold(0, |a: uint, b: uint| 10*a + b), 54321);
} }

View file

@ -26,7 +26,7 @@ impl<T> Foo {
// issue 8134 // issue 8134
pub struct Parser<T>; pub struct Parser<T>;
impl<T: std::iterator::Iterator<char>> Parser<T> { impl<T: std::iter::Iterator<char>> Parser<T> {
fn in_doctype(&mut self) { fn in_doctype(&mut self) {
static DOCTYPEPattern: [char, ..6] = ['O', 'C', 'T', 'Y', 'P', 'E']; static DOCTYPEPattern: [char, ..6] = ['O', 'C', 'T', 'Y', 'P', 'E'];
} }

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use std::iterator::*; use std::iter::*;
// Unfold had a bug with 'self that mean it didn't work // Unfold had a bug with 'self that mean it didn't work
// cross-crate // cross-crate