auto merge of #7474 : Seldaek/rust/clean-iter, r=thestinger

I think it's WIP - but I wanted to ask for feedback (/cc @thestinger)

I had to move the impl of FromIter for vec into extra::iter because I don't think std can depend on extra, but that's a bit messed up. Similarly some FromIter uses are gone now, not sure if this is fixable or if I made a complete mess here..
This commit is contained in:
bors
2013-07-03 01:07:55 -07:00
6 changed files with 418 additions and 325 deletions

View File

@@ -19,7 +19,6 @@ use cmp;
use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
use clone::Clone;
use iterator::{FromIterator, Iterator, IteratorUtil};
use iter::FromIter;
use kinds::Copy;
use libc;
use libc::c_void;
@@ -2168,15 +2167,6 @@ pub struct VecMutRevIterator<'self, T> {
}
iterator!{impl VecMutRevIterator -> &'self mut T, -1}
impl<T> FromIter<T> for ~[T]{
#[inline]
pub fn from_iter(iter: &fn(f: &fn(T) -> bool) -> bool) -> ~[T] {
let mut v = ~[];
for iter |x| { v.push(x) }
v
}
}
#[cfg(stage0)]
impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
pub fn from_iterator(iterator: &mut T) -> ~[A] {