Demode tuple
This commit is contained in:
parent
ef23d77633
commit
e0d5d03451
@ -36,7 +36,7 @@ impl<T: Copy, U: Copy> (T, U): TupleOps<T,U> {
|
||||
|
||||
trait ExtendedTupleOps<A,B> {
|
||||
fn zip() -> ~[(A, B)];
|
||||
fn map<C>(f: fn(A, B) -> C) -> ~[C];
|
||||
fn map<C>(f: &fn(A, B) -> C) -> ~[C];
|
||||
}
|
||||
|
||||
impl<A: Copy, B: Copy> (&[A], &[B]): ExtendedTupleOps<A,B> {
|
||||
@ -46,7 +46,7 @@ impl<A: Copy, B: Copy> (&[A], &[B]): ExtendedTupleOps<A,B> {
|
||||
vec::zip_slice(a, b)
|
||||
}
|
||||
|
||||
fn map<C>(f: fn(A, B) -> C) -> ~[C] {
|
||||
fn map<C>(f: &fn(A, B) -> C) -> ~[C] {
|
||||
let (a, b) = self;
|
||||
vec::map2(a, b, f)
|
||||
}
|
||||
@ -60,7 +60,7 @@ impl<A: Copy, B: Copy> (~[A], ~[B]): ExtendedTupleOps<A,B> {
|
||||
vec::zip(move a, move b)
|
||||
}
|
||||
|
||||
fn map<C>(f: fn(A, B) -> C) -> ~[C] {
|
||||
fn map<C>(f: &fn(A, B) -> C) -> ~[C] {
|
||||
// FIXME #2543: Bad copy
|
||||
let (a, b) = copy self;
|
||||
vec::map2(a, b, f)
|
||||
|
Loading…
Reference in New Issue
Block a user