mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
auto merge of #9065 : thestinger/rust/iter, r=alexcrichton
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:
@@ -200,7 +200,7 @@ for i in range(0, 5) {
|
||||
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"
|
||||
}
|
||||
~~~
|
||||
|
||||
+1
-1
@@ -310,7 +310,7 @@ def emit_decomp_module(f, canon, compat, combine):
|
||||
+ " bsearch_range_value_table(c, combining_class_table)\n"
|
||||
+ " }\n\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")
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
|
||||
use std::cmp;
|
||||
use std::iterator::RandomAccessIterator;
|
||||
use std::iterator::{Invert, Enumerate, Repeat, Map, Zip};
|
||||
use std::iter::RandomAccessIterator;
|
||||
use std::iter::{Invert, Enumerate, Repeat, Map, Zip};
|
||||
use std::num;
|
||||
use std::ops;
|
||||
use std::uint;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
use std::cast;
|
||||
use std::ptr;
|
||||
use std::util;
|
||||
use std::iterator::{FromIterator, Extendable, Invert};
|
||||
use std::iterator;
|
||||
use std::iter::Invert;
|
||||
use std::iter;
|
||||
|
||||
use container::Deque;
|
||||
|
||||
@@ -593,27 +593,27 @@ fn extend<T: Iterator<A>>(&mut self, iterator: &mut T) {
|
||||
impl<A: Eq> Eq for DList<A> {
|
||||
fn eq(&self, other: &DList<A>) -> bool {
|
||||
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 {
|
||||
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> {
|
||||
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 {
|
||||
iterator::order::le(self.iter(), other.iter())
|
||||
iter::order::le(self.iter(), other.iter())
|
||||
}
|
||||
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 {
|
||||
iterator::order::ge(self.iter(), other.iter())
|
||||
iter::order::ge(self.iter(), other.iter())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::iterator::Iterator;
|
||||
|
||||
#[deriving(Clone, Eq, IterBytes, ToStr)]
|
||||
/// A specialized Set implementation to use enum types.
|
||||
pub struct EnumSet<E> {
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
use std::char;
|
||||
use std::cast::transmute;
|
||||
use std::iterator;
|
||||
use std::float;
|
||||
use std::hashmap::HashMap;
|
||||
use std::io::WriterUtil;
|
||||
@@ -489,7 +488,7 @@ pub struct Parser<T> {
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
rdr: rdr,
|
||||
ch: '\x00',
|
||||
@@ -500,7 +499,7 @@ pub fn Parser<T : iterator::Iterator<char>>(rdr: ~T) -> Parser<T> {
|
||||
p
|
||||
}
|
||||
|
||||
impl<T: iterator::Iterator<char>> Parser<T> {
|
||||
impl<T: Iterator<char>> Parser<T> {
|
||||
pub fn parse(&mut self) -> Result<Json, Error> {
|
||||
match self.parse_value() {
|
||||
Ok(value) => {
|
||||
@@ -518,7 +517,7 @@ pub fn parse(&mut self) -> Result<Json, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T : iterator::Iterator<char>> Parser<T> {
|
||||
impl<T : Iterator<char>> Parser<T> {
|
||||
// FIXME: #8971: unsound
|
||||
fn eof(&self) -> bool { self.ch == unsafe { transmute(-1u32) } }
|
||||
|
||||
|
||||
@@ -2011,13 +2011,13 @@ fn test_neg() {
|
||||
#[cfg(test)]
|
||||
mod bench {
|
||||
use super::*;
|
||||
use std::{iterator, util};
|
||||
use std::{iter, util};
|
||||
use std::num::{Zero, One};
|
||||
use extra::test::BenchHarness;
|
||||
|
||||
fn factorial(n: uint) -> BigUint {
|
||||
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
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
use std::unstable::intrinsics::{move_val_init, init};
|
||||
use std::util::{replace, swap};
|
||||
use std::vec;
|
||||
use std::iterator::{FromIterator, Extendable};
|
||||
|
||||
/// A priority queue implemented with a binary heap
|
||||
#[deriving(Clone)]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
use std::num;
|
||||
use std::vec;
|
||||
use std::iterator::{FromIterator, Invert, RandomAccessIterator, Extendable};
|
||||
use std::iter::{Invert, RandomAccessIterator};
|
||||
|
||||
use container::Deque;
|
||||
|
||||
@@ -694,13 +694,13 @@ fn test_mut_rev_iter() {
|
||||
|
||||
#[test]
|
||||
fn test_from_iterator() {
|
||||
use std::iterator;
|
||||
use std::iter;
|
||||
let v = ~[1,2,3,4,5,6,7];
|
||||
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
|
||||
let u: ~[int] = deq.iter().map(|&x| x).collect();
|
||||
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();
|
||||
for (i, &x) in deq.iter().enumerate() {
|
||||
assert_eq!(2*i, x);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#[allow(missing_doc)];
|
||||
|
||||
use std::iterator::{Iterator, Enumerate, FilterMap, Invert};
|
||||
use std::iter::{Enumerate, FilterMap, Invert};
|
||||
use std::util::replace;
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
use std::util::{swap, replace};
|
||||
use std::iterator::{FromIterator, Extendable, Peekable};
|
||||
use std::iter::{Peekable};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
// This is implemented as an AA tree, which is a simplified variation of
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
use middle::moves;
|
||||
use util::ppaux::ty_to_str;
|
||||
|
||||
use std::iterator;
|
||||
use std::iter;
|
||||
use std::num;
|
||||
use std::vec;
|
||||
use extra::sort;
|
||||
@@ -282,7 +282,7 @@ pub fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
|
||||
_ => 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) {
|
||||
not_useful => (),
|
||||
ref u => return *u,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
use lib::llvm::{llvm, BasicBlockRef};
|
||||
use middle::trans::value::{UserIterator, Value};
|
||||
use std::iterator::{Filter, Map};
|
||||
use std::iter::{Filter, Map};
|
||||
|
||||
pub struct BasicBlock(BasicBlockRef);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
use clone::Clone;
|
||||
use container::Container;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use option::{Option, Some, None};
|
||||
use sys;
|
||||
use unstable::raw::Repr;
|
||||
|
||||
+2
-2
@@ -9,14 +9,14 @@
|
||||
// except according to those terms.
|
||||
|
||||
use cast;
|
||||
use iterator::{Iterator,range};
|
||||
use iter::{Iterator, range};
|
||||
use libc;
|
||||
use ops::Drop;
|
||||
use option::{Option, Some, None};
|
||||
use ptr::RawPtr;
|
||||
use ptr;
|
||||
use str::StrSlice;
|
||||
use vec::{ImmutableVector,CopyableVector};
|
||||
use vec::{ImmutableVector, CopyableVector};
|
||||
use container::Container;
|
||||
|
||||
/// Resolution options for the `null_byte` condition
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
use clone::Clone;
|
||||
use container::Container;
|
||||
use cmp::Eq;
|
||||
use iterator::{Iterator, FilterMap};
|
||||
use iter::{Iterator, FilterMap};
|
||||
use result::Result;
|
||||
use result;
|
||||
use str::StrSlice;
|
||||
|
||||
@@ -812,7 +812,7 @@ fn fmt(c: &$ty, f: &mut Formatter) {
|
||||
#[doc(hidden)]
|
||||
pub fn upperhex(buf: &[u8], f: &mut Formatter) {
|
||||
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 {
|
||||
'a' .. 'f' => (buf[i] - 'a' as u8) + 'A' as u8,
|
||||
c => c as u8,
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
use char;
|
||||
use str;
|
||||
use iterator;
|
||||
|
||||
condition! { pub parse_error: ~str -> (); }
|
||||
|
||||
@@ -152,7 +151,7 @@ pub struct Parser<'self> {
|
||||
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>> {
|
||||
match self.cur.clone().next() {
|
||||
Some((_, '#')) => { self.cur.next(); Some(CurrentArgument) }
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#[allow(missing_doc)];
|
||||
|
||||
use container::Container;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use option::{Some, None};
|
||||
use rt::io::Writer;
|
||||
use str::OwnedStr;
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
use clone::Clone;
|
||||
use cmp::{Eq, Equiv};
|
||||
use hash::Hash;
|
||||
use iterator::{Iterator, FromIterator, Extendable};
|
||||
use iterator::{FilterMap, Chain, Repeat, Zip};
|
||||
use iter::{Iterator, FromIterator, Extendable};
|
||||
use iter::{FilterMap, Chain, Repeat, Zip};
|
||||
use num;
|
||||
use option::{None, Option, Some};
|
||||
use rand::RngUtil;
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
use c_str::ToCStr;
|
||||
use container::Container;
|
||||
use int;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use libc::consts::os::posix88::*;
|
||||
use libc::{c_int, c_void, size_t};
|
||||
use libc;
|
||||
|
||||
@@ -363,7 +363,7 @@ fn inspect<'r>(self, f: &'r fn(&A)) -> Inspect<'r, A, Self> {
|
||||
/// # Example
|
||||
///
|
||||
/// ~~~ {.rust}
|
||||
/// use std::iterator::Counter;
|
||||
/// use std::iter::count;
|
||||
///
|
||||
/// for i in count(0, 10) {
|
||||
/// printfln!("%d", i);
|
||||
@@ -754,7 +754,7 @@ pub trait MultiplicativeIterator<A> {
|
||||
/// # Example
|
||||
///
|
||||
/// ~~~ {.rust}
|
||||
/// use std::iterator::Counter;
|
||||
/// use std::iter::count;
|
||||
///
|
||||
/// fn factorial(n: uint) -> uint {
|
||||
/// count(1u, 1).take_while(|&i| i <= n).product()
|
||||
@@ -45,8 +45,8 @@
|
||||
use cmp::{Eq,Ord};
|
||||
use util;
|
||||
use num::Zero;
|
||||
use iterator;
|
||||
use iterator::{Iterator, DoubleEndedIterator, ExactSize};
|
||||
use iter;
|
||||
use iter::{Iterator, DoubleEndedIterator, ExactSize};
|
||||
use str::{StrSlice, OwnedStr};
|
||||
use to_str::ToStr;
|
||||
use clone::DeepClone;
|
||||
@@ -60,19 +60,19 @@ pub enum Option<T> {
|
||||
|
||||
impl<T: Eq + Ord> Ord for Option<T> {
|
||||
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 {
|
||||
iterator::order::le(self.iter(), other.iter())
|
||||
iter::order::le(self.iter(), other.iter())
|
||||
}
|
||||
|
||||
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 {
|
||||
iterator::order::gt(self.iter(), other.iter())
|
||||
iter::order::gt(self.iter(), other.iter())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
use clone::Clone;
|
||||
use container::Container;
|
||||
use io;
|
||||
use iterator::range;
|
||||
use iter::range;
|
||||
use libc;
|
||||
use libc::{c_char, c_void, c_int, size_t};
|
||||
use libc::FILE;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
use clone::Clone;
|
||||
use cmp::Eq;
|
||||
use container::Container;
|
||||
use iterator::{Iterator, range};
|
||||
use iter::{Iterator, range};
|
||||
use libc;
|
||||
use num;
|
||||
use option::{None, Option, Some};
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
// Reexported functions
|
||||
pub use io::{print, println};
|
||||
pub use iterator::range;
|
||||
pub use iter::range;
|
||||
pub use from_str::from_str;
|
||||
|
||||
// Reexported types and traits
|
||||
@@ -51,9 +51,9 @@
|
||||
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
|
||||
pub use hash::Hash;
|
||||
pub use num::Times;
|
||||
pub use iterator::{FromIterator, Extendable};
|
||||
pub use iterator::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator};
|
||||
pub use iterator::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
|
||||
pub use iter::{FromIterator, Extendable};
|
||||
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator};
|
||||
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
|
||||
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
|
||||
pub use num::{Orderable, Signed, Unsigned, Round};
|
||||
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
use clone::Clone;
|
||||
#[cfg(not(test))]
|
||||
use cmp::Equiv;
|
||||
use iterator::{range, Iterator};
|
||||
use iter::{range, Iterator};
|
||||
use option::{Option, Some, None};
|
||||
#[cfg(stage0)]
|
||||
use sys;
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ fn main () {
|
||||
use cmp;
|
||||
use container::Container;
|
||||
use int;
|
||||
use iterator::{Iterator, range};
|
||||
use iter::{Iterator, range};
|
||||
use local_data;
|
||||
use num;
|
||||
use prelude::*;
|
||||
@@ -957,7 +957,7 @@ pub fn random<T: Rand>() -> T {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use iterator::{Iterator, range};
|
||||
use iter::{Iterator, range};
|
||||
use option::{Option, Some};
|
||||
use super::*;
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
use char;
|
||||
use container::Container;
|
||||
use rt::io;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use libc::c_void;
|
||||
use option::{Some, None};
|
||||
use ptr;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
use char;
|
||||
use container::Container;
|
||||
use io::{Writer, WriterUtil};
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use libc::c_void;
|
||||
use option::{Some, None};
|
||||
use ptr;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
use clone::Clone;
|
||||
use cmp::Eq;
|
||||
use either;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use option::{None, Option, Some, OptionIterator};
|
||||
use vec;
|
||||
use vec::OwnedVector;
|
||||
@@ -335,7 +335,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
use either;
|
||||
use iterator::range;
|
||||
use iter::range;
|
||||
use str::OwnedStr;
|
||||
use vec::ImmutableVector;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ pub fn clone() -> Option<~[~str]> {
|
||||
mod imp {
|
||||
use libc;
|
||||
use option::{Option, Some, None};
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use str;
|
||||
use unstable::finally::Finally;
|
||||
use util;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
use uint;
|
||||
use int;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use vec;
|
||||
use rt::io::{Reader, Writer, Decorator};
|
||||
use rt::io::{read_error, standard_error, EndOfFile, DEFAULT_BUF_SIZE};
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
use cell::Cell;
|
||||
use clone::Clone;
|
||||
use container::Container;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use option::{Option, None, Some};
|
||||
use ptr::RawPtr;
|
||||
use rt::local::Local;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
use borrow::{to_uint};
|
||||
use cell::Cell;
|
||||
use rand::{XorShiftRng, RngUtil};
|
||||
use iterator::{range};
|
||||
use iter::range;
|
||||
use vec::{OwnedVector};
|
||||
|
||||
/// A scheduler is responsible for coordinating the execution of Tasks
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
use cell::Cell;
|
||||
use clone::Clone;
|
||||
use container::Container;
|
||||
use iterator::{Iterator, range};
|
||||
use iter::{Iterator, range};
|
||||
use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
|
||||
use vec::{OwnedVector, MutableVector, ImmutableVector};
|
||||
use rt::sched::Scheduler;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#[cfg(test)] use rt::test::{spawntask,
|
||||
next_test_ip4,
|
||||
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.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
use cell::Cell;
|
||||
use comm;
|
||||
use container::Container;
|
||||
use iterator::{Iterator, DoubleEndedIterator};
|
||||
use iter::{Iterator, DoubleEndedIterator};
|
||||
use option::*;
|
||||
// use either::{Either, Left, Right};
|
||||
// use rt::kill::BlockedTask;
|
||||
@@ -134,7 +134,7 @@ mod test {
|
||||
use comm::GenericChan;
|
||||
use task;
|
||||
use cell::Cell;
|
||||
use iterator::{Iterator, range};
|
||||
use iter::{Iterator, range};
|
||||
|
||||
#[test] #[should_fail]
|
||||
fn select_doesnt_get_trolled() {
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ pub mod linkhack {
|
||||
pub mod from_str;
|
||||
#[path = "num/num.rs"]
|
||||
pub mod num;
|
||||
pub mod iterator;
|
||||
pub mod iter;
|
||||
pub mod to_str;
|
||||
pub mod to_bytes;
|
||||
pub mod clone;
|
||||
|
||||
+8
-8
@@ -23,9 +23,9 @@
|
||||
use clone::{Clone, DeepClone};
|
||||
use container::{Container, Mutable};
|
||||
use num::Times;
|
||||
use iterator::{Iterator, FromIterator, Extendable};
|
||||
use iterator::{Filter, AdditiveIterator, Map};
|
||||
use iterator::{Invert, DoubleEndedIterator, ExactSize};
|
||||
use iter::{Iterator, FromIterator, Extendable};
|
||||
use iter::{Filter, AdditiveIterator, Map};
|
||||
use iter::{Invert, DoubleEndedIterator, ExactSize};
|
||||
use libc;
|
||||
use num::{Saturating};
|
||||
use option::{None, Option, Some};
|
||||
@@ -592,7 +592,7 @@ fn next(&mut self) -> Option<&'self str> {
|
||||
|
||||
// Helper functions used for Unicode normalization
|
||||
fn canonical_sort(comb: &mut [(char, u8)]) {
|
||||
use iterator::range;
|
||||
use iter::range;
|
||||
use tuple::CopyableTuple;
|
||||
|
||||
let len = comb.len();
|
||||
@@ -3325,7 +3325,7 @@ macro_rules! t (
|
||||
|
||||
#[test]
|
||||
fn test_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let s = ~"ศไทย中华Việt Nam";
|
||||
let v = ~['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
|
||||
|
||||
@@ -3341,7 +3341,7 @@ fn test_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_rev_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let s = ~"ศไทย中华Việt Nam";
|
||||
let v = ~['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];
|
||||
|
||||
@@ -3397,7 +3397,7 @@ fn test_byte_rev_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_char_offset_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let p = [0, 3, 6, 9, 12, 15, 18, 19, 20, 23, 24, 25, 26, 27];
|
||||
let v = ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
|
||||
@@ -3415,7 +3415,7 @@ fn test_char_offset_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_char_offset_rev_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let p = [27, 26, 25, 24, 23, 20, 19, 18, 15, 12, 9, 6, 3, 0];
|
||||
let v = ['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use container::Container;
|
||||
use cast;
|
||||
use ptr;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use vec::{CopyableVector, ImmutableVector};
|
||||
use to_bytes::IterBytes;
|
||||
use option::{Some, None};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
use container::Container;
|
||||
use io;
|
||||
use io::Writer;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use option::{None, Option, Some};
|
||||
use str::{Str, StrSlice};
|
||||
use vec::{Vector, ImmutableVector};
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use hashmap::HashMap;
|
||||
use hashmap::HashSet;
|
||||
use hash::Hash;
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
use cmp::Eq;
|
||||
use vec::ImmutableVector;
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
//! An ordered map and set for integer keys implemented as a radix trie
|
||||
|
||||
use prelude::*;
|
||||
use iterator::{FromIterator, Extendable};
|
||||
use uint;
|
||||
use util::{swap, replace};
|
||||
use vec;
|
||||
|
||||
@@ -3628,7 +3628,7 @@ pub fn canonical_combining_class(c: char) -> u8 {
|
||||
}
|
||||
|
||||
fn d(c: char, i: &fn(char), k: bool) {
|
||||
use iterator::Iterator;
|
||||
use iter::Iterator;
|
||||
if c <= '\x7f' { i(c); return; }
|
||||
|
||||
match bsearch_table(c, canonical_table) {
|
||||
|
||||
+10
-10
@@ -63,7 +63,7 @@
|
||||
use container::{Container, Mutable};
|
||||
use cmp::{Eq, TotalOrd, Ordering, Less, Equal, Greater};
|
||||
use cmp;
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
use libc::c_void;
|
||||
use num::{Integer, Zero, CheckedAdd, Saturating};
|
||||
use option::{None, Option, Some};
|
||||
@@ -592,7 +592,7 @@ pub mod traits {
|
||||
|
||||
use clone::Clone;
|
||||
use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Equiv};
|
||||
use iterator::order;
|
||||
use iter::order;
|
||||
use ops::Add;
|
||||
|
||||
impl<'self,T:Eq> Eq for &'self [T] {
|
||||
@@ -3241,7 +3241,7 @@ fn test_total_ord() {
|
||||
|
||||
#[test]
|
||||
fn test_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let mut it = xs.iter();
|
||||
assert_eq!(it.size_hint(), (5, Some(5)));
|
||||
@@ -3260,7 +3260,7 @@ fn test_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_random_access_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let mut it = xs.iter();
|
||||
|
||||
@@ -3299,7 +3299,7 @@ fn test_random_access_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_iter_size_hints() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let mut xs = [1, 2, 5, 10, 11];
|
||||
assert_eq!(xs.iter().size_hint(), (5, Some(5)));
|
||||
assert_eq!(xs.rev_iter().size_hint(), (5, Some(5)));
|
||||
@@ -3320,7 +3320,7 @@ fn test_iter_clone() {
|
||||
|
||||
#[test]
|
||||
fn test_mut_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let mut xs = [1, 2, 3, 4, 5];
|
||||
for x in xs.mut_iter() {
|
||||
*x += 1;
|
||||
@@ -3330,7 +3330,7 @@ fn test_mut_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_rev_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let ys = [11, 10, 5, 2, 1];
|
||||
@@ -3344,7 +3344,7 @@ fn test_rev_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_mut_rev_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let mut xs = [1u, 2, 3, 4, 5];
|
||||
for (i,x) in xs.mut_rev_iter().enumerate() {
|
||||
*x += i;
|
||||
@@ -3354,14 +3354,14 @@ fn test_mut_rev_iterator() {
|
||||
|
||||
#[test]
|
||||
fn test_move_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let xs = ~[1u,2,3,4,5];
|
||||
assert_eq!(xs.move_iter().fold(0, |a: uint, b: uint| 10*a + b), 12345);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_move_rev_iterator() {
|
||||
use iterator::*;
|
||||
use iter::*;
|
||||
let xs = ~[1u,2,3,4,5];
|
||||
assert_eq!(xs.move_rev_iter().fold(0, |a: uint, b: uint| 10*a + b), 54321);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ pub fn foo(&self) {
|
||||
|
||||
// issue 8134
|
||||
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) {
|
||||
static DOCTYPEPattern: [char, ..6] = ['O', 'C', 'T', 'Y', 'P', 'E'];
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::iterator::*;
|
||||
use std::iter::*;
|
||||
|
||||
// Unfold had a bug with 'self that mean it didn't work
|
||||
// cross-crate
|
||||
|
||||
Reference in New Issue
Block a user