about summary refs log tree commit diff
path: root/src/libstd/either.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/either.rs')
-rw-r--r--src/libstd/either.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/either.rs b/src/libstd/either.rs
index 4fb43e5157b..d0378fa947b 100644
--- a/src/libstd/either.rs
+++ b/src/libstd/either.rs
@@ -12,10 +12,11 @@
 
 #[allow(missing_doc)];
 
+use option::{Some, None};
 use clone::Clone;
 use container::Container;
 use cmp::Eq;
-use iterator::IteratorUtil;
+use iterator::Iterator;
 use result::Result;
 use result;
 use str::StrSlice;
@@ -46,7 +47,7 @@ pub fn either<T, U, V>(f_left: &fn(&T) -> V,
 /// Extracts from a vector of either all the left values
 pub fn lefts<T:Clone,U>(eithers: &[Either<T, U>]) -> ~[T] {
     do vec::build_sized(eithers.len()) |push| {
-        for eithers.iter().advance |elt| {
+        foreach elt in eithers.iter() {
             match *elt {
                 Left(ref l) => { push((*l).clone()); }
                 _ => { /* fallthrough */ }
@@ -58,7 +59,7 @@ pub fn lefts<T:Clone,U>(eithers: &[Either<T, U>]) -> ~[T] {
 /// Extracts from a vector of either all the right values
 pub fn rights<T, U: Clone>(eithers: &[Either<T, U>]) -> ~[U] {
     do vec::build_sized(eithers.len()) |push| {
-        for eithers.iter().advance |elt| {
+        foreach elt in eithers.iter() {
             match *elt {
                 Right(ref r) => { push((*r).clone()); }
                 _ => { /* fallthrough */ }
@@ -74,7 +75,7 @@ pub fn rights<T, U: Clone>(eithers: &[Either<T, U>]) -> ~[U] {
 pub fn partition<T, U>(eithers: ~[Either<T, U>]) -> (~[T], ~[U]) {
     let mut lefts: ~[T] = ~[];
     let mut rights: ~[U] = ~[];
-    for eithers.consume_iter().advance |elt| {
+    foreach elt in eithers.consume_iter() {
         match elt {
             Left(l) => lefts.push(l),
             Right(r) => rights.push(r)