about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-08-13 21:00:58 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-08-15 21:12:34 -0400
commit1f89eb867a33b25c3df0078eb2ec18d1fc00bc43 (patch)
treebb720cd8083e0aa69aadb88d61abb681c28887cc /src/libstd
parent6a21f22767596fc80fa55eade9824290d14cd85a (diff)
downloadrust-1f89eb867a33b25c3df0078eb2ec18d1fc00bc43.tar.gz
rust-1f89eb867a33b25c3df0078eb2ec18d1fc00bc43.zip
tuple: remove obsolete ExtendedTupleOps
replaced by iterators (generic composable `map` and `zip` adaptors)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/prelude.rs2
-rw-r--r--src/libstd/tuple.rs52
2 files changed, 1 insertions, 53 deletions
diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs
index deee49bc472..63f73002009 100644
--- a/src/libstd/prelude.rs
+++ b/src/libstd/prelude.rs
@@ -69,7 +69,7 @@ pub use str::{Str, StrVector, StrSlice, OwnedStr};
 pub use from_str::FromStr;
 pub use to_bytes::IterBytes;
 pub use to_str::{ToStr, ToStrConsume};
-pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
+pub use tuple::{CopyableTuple, ImmutableTuple};
 pub use tuple::{CloneableTuple1, ImmutableTuple1};
 pub use tuple::{CloneableTuple2, CloneableTuple3, CloneableTuple4, CloneableTuple5};
 pub use tuple::{CloneableTuple6, CloneableTuple7, CloneableTuple8, CloneableTuple9};
diff --git a/src/libstd/tuple.rs b/src/libstd/tuple.rs
index 8a3c024ede5..12073a1f4f0 100644
--- a/src/libstd/tuple.rs
+++ b/src/libstd/tuple.rs
@@ -13,9 +13,6 @@
 #[allow(missing_doc)];
 
 use clone::Clone;
-use vec;
-use vec::ImmutableVector;
-use iterator::Iterator;
 
 pub use self::inner::*;
 
@@ -79,55 +76,6 @@ impl<T, U> ImmutableTuple<T, U> for (T, U) {
     }
 }
 
-pub trait ExtendedTupleOps<A,B> {
-    fn zip(&self) -> ~[(A, B)];
-    fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C];
-}
-
-impl<'self,
-     A:Clone,
-     B:Clone>
-     ExtendedTupleOps<A,B> for
-     (&'self [A], &'self [B]) {
-    #[inline]
-    fn zip(&self) -> ~[(A, B)] {
-        match *self {
-            (ref a, ref b) => {
-                vec::zip_slice(*a, *b)
-            }
-        }
-    }
-
-    #[inline]
-    fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
-        match *self {
-            (ref a, ref b) => {
-                a.iter().zip(b.iter()).map(|(aa, bb)| f(aa, bb)).collect()
-            }
-        }
-    }
-}
-
-impl<A:Clone, B:Clone> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
-    #[inline]
-    fn zip(&self) -> ~[(A, B)] {
-        match *self {
-            (ref a, ref b) => {
-                vec::zip_slice(*a, *b)
-            }
-        }
-    }
-
-    #[inline]
-    fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
-        match *self {
-            (ref a, ref b) => {
-                a.iter().zip(b.iter()).map(|(aa, bb)| f(aa, bb)).collect()
-            }
-        }
-    }
-}
-
 // macro for implementing n-ary tuple functions and operations
 
 macro_rules! tuple_impls {