Skip to content

Commit 1f89eb8

Browse files
committed
tuple: remove obsolete ExtendedTupleOps
replaced by iterators (generic composable `map` and `zip` adaptors)
1 parent 6a21f22 commit 1f89eb8

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

src/libstd/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub use str::{Str, StrVector, StrSlice, OwnedStr};
6969
pub use from_str::FromStr;
7070
pub use to_bytes::IterBytes;
7171
pub use to_str::{ToStr, ToStrConsume};
72-
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
72+
pub use tuple::{CopyableTuple, ImmutableTuple};
7373
pub use tuple::{CloneableTuple1, ImmutableTuple1};
7474
pub use tuple::{CloneableTuple2, CloneableTuple3, CloneableTuple4, CloneableTuple5};
7575
pub use tuple::{CloneableTuple6, CloneableTuple7, CloneableTuple8, CloneableTuple9};

src/libstd/tuple.rs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#[allow(missing_doc)];
1414

1515
use clone::Clone;
16-
use vec;
17-
use vec::ImmutableVector;
18-
use iterator::Iterator;
1916

2017
pub use self::inner::*;
2118

@@ -79,55 +76,6 @@ impl<T, U> ImmutableTuple<T, U> for (T, U) {
7976
}
8077
}
8178

82-
pub trait ExtendedTupleOps<A,B> {
83-
fn zip(&self) -> ~[(A, B)];
84-
fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C];
85-
}
86-
87-
impl<'self,
88-
A:Clone,
89-
B:Clone>
90-
ExtendedTupleOps<A,B> for
91-
(&'self [A], &'self [B]) {
92-
#[inline]
93-
fn zip(&self) -> ~[(A, B)] {
94-
match *self {
95-
(ref a, ref b) => {
96-
vec::zip_slice(*a, *b)
97-
}
98-
}
99-
}
100-
101-
#[inline]
102-
fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
103-
match *self {
104-
(ref a, ref b) => {
105-
a.iter().zip(b.iter()).map(|(aa, bb)| f(aa, bb)).collect()
106-
}
107-
}
108-
}
109-
}
110-
111-
impl<A:Clone, B:Clone> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
112-
#[inline]
113-
fn zip(&self) -> ~[(A, B)] {
114-
match *self {
115-
(ref a, ref b) => {
116-
vec::zip_slice(*a, *b)
117-
}
118-
}
119-
}
120-
121-
#[inline]
122-
fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
123-
match *self {
124-
(ref a, ref b) => {
125-
a.iter().zip(b.iter()).map(|(aa, bb)| f(aa, bb)).collect()
126-
}
127-
}
128-
}
129-
}
130-
13179
// macro for implementing n-ary tuple functions and operations
13280

13381
macro_rules! tuple_impls {

0 commit comments

Comments
 (0)