diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-29 15:05:50 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-30 21:59:44 +1000 |
| commit | c0a20d2929a7c0d6af0de899198df4f26453d877 (patch) | |
| tree | 8347aea61a2f042c6114cadae3e11233582d22d5 /src/libstd/tuple.rs | |
| parent | a396e1e2e95acc07f2804be2079d5b692753d4bb (diff) | |
| download | rust-c0a20d2929a7c0d6af0de899198df4f26453d877.tar.gz rust-c0a20d2929a7c0d6af0de899198df4f26453d877.zip | |
Remove vec::{map, mapi, zip_map} and the methods, except for .map, since this
is very common, and the replacement (.iter().transform().collect()) is very ugly.
Diffstat (limited to 'src/libstd/tuple.rs')
| -rw-r--r-- | src/libstd/tuple.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/tuple.rs b/src/libstd/tuple.rs index fefd55c3541..45702546278 100644 --- a/src/libstd/tuple.rs +++ b/src/libstd/tuple.rs @@ -14,6 +14,8 @@ use kinds::Copy; use vec; +use vec::ImmutableVector; +use iterator::IteratorUtil; pub use self::inner::*; @@ -96,7 +98,7 @@ impl<'self,A:Copy,B:Copy> ExtendedTupleOps<A,B> for (&'self [A], &'self [B]) { fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] { match *self { (ref a, ref b) => { - vec::map_zip(*a, *b, f) + a.iter().zip(b.iter()).transform(|(aa, bb)| f(aa, bb)).collect() } } } @@ -116,7 +118,7 @@ impl<A:Copy,B:Copy> ExtendedTupleOps<A,B> for (~[A], ~[B]) { fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] { match *self { (ref a, ref b) => { - vec::map_zip(*a, *b, f) + a.iter().zip(b.iter()).transform(|(aa, bb)| f(aa, bb)).collect() } } } |
