Skip to content

Commit c85ad63

Browse files
committed
---
yaml --- r: 24262 b: refs/heads/master c: 2fe451c h: refs/heads/master v: v3
1 parent b9f8c4e commit c85ad63

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d9a06be2249a539b17f629ea310c4a4c01a57197
2+
refs/heads/master: 2fe451c6bab39f87070edfd9a4160296bf4a2d9e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libcore/either.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ fn partition<T: Copy, U: Copy>(eithers: &[Either<T, U>])
6868
let mut rights: ~[U] = ~[];
6969
for vec::each(eithers) |elt| {
7070
match *elt {
71-
Left(l) => lefts.push(l),
72-
Right(r) => rights.push(r)
71+
Left(copy l) => lefts.push(l),
72+
Right(copy r) => rights.push(r)
7373
}
7474
}
7575
return {lefts: move lefts, rights: move rights};
@@ -79,8 +79,8 @@ pure fn flip<T: Copy, U: Copy>(eith: &Either<T, U>) -> Either<U, T> {
7979
//! Flips between left and right of a given either
8080
8181
match *eith {
82-
Right(r) => Left(r),
83-
Left(l) => Right(l)
82+
Right(copy r) => Left(r),
83+
Left(copy l) => Right(l)
8484
}
8585
}
8686

@@ -93,8 +93,8 @@ pure fn to_result<T: Copy, U: Copy>(eith: &Either<T, U>) -> Result<U, T> {
9393
*/
9494

9595
match *eith {
96-
Right(r) => result::Ok(r),
97-
Left(l) => result::Err(l)
96+
Right(copy r) => result::Ok(r),
97+
Left(copy l) => result::Err(l)
9898
}
9999
}
100100

@@ -129,16 +129,16 @@ pure fn unwrap_right<T,U>(+eith: Either<T,U>) -> U {
129129
impl<T:Eq,U:Eq> Either<T,U> : Eq {
130130
pure fn eq(other: &Either<T,U>) -> bool {
131131
match self {
132-
Left(a) => {
132+
Left(ref a) => {
133133
match (*other) {
134-
Left(ref b) => a.eq(b),
134+
Left(ref b) => (*a).eq(b),
135135
Right(_) => false
136136
}
137137
}
138-
Right(a) => {
138+
Right(ref a) => {
139139
match (*other) {
140140
Left(_) => false,
141-
Right(ref b) => a.eq(b)
141+
Right(ref b) => (*a).eq(b)
142142
}
143143
}
144144
}

0 commit comments

Comments
 (0)