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 ImmutableTuple for (T, U) { } } -pub trait ExtendedTupleOps { - fn zip(&self) -> ~[(A, B)]; - fn map(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C]; -} - -impl<'self, - A:Clone, - B:Clone> - ExtendedTupleOps 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(&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 ExtendedTupleOps for (~[A], ~[B]) { - #[inline] - fn zip(&self) -> ~[(A, B)] { - match *self { - (ref a, ref b) => { - vec::zip_slice(*a, *b) - } - } - } - - #[inline] - fn map(&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 {