Skip to content

Commit 839be34

Browse files
committed
---
yaml --- r: 65057 b: refs/heads/master c: ee4d11f h: refs/heads/master i: 65055: 6f31798 v: v3
1 parent ad197b3 commit 839be34

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
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: ce1e211eeb607fdc131cedc764ccb7d824b28b70
2+
refs/heads/master: ee4d11f37ea3f1bff8103c0e6b369a972f4b1bf2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libcore/tuple.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,28 @@ pub trait CopyableTuple<T, U> {
2222
}
2323

2424
impl<T:Copy,U:Copy> CopyableTuple<T, U> for (T, U) {
25-
2625
/// Return the first element of self
2726
#[inline(always)]
2827
fn first(&self) -> T {
29-
let (t, _) = *self;
30-
return t;
28+
match *self {
29+
(t, _) => t,
30+
}
3131
}
3232

3333
/// Return the second element of self
3434
#[inline(always)]
3535
fn second(&self) -> U {
36-
let (_, u) = *self;
37-
return u;
36+
match *self {
37+
(_, u) => u,
38+
}
3839
}
3940

4041
/// Return the results of swapping the two elements of self
4142
#[inline(always)]
4243
fn swap(&self) -> (U, T) {
43-
let (t, u) = *self;
44-
return (u, t);
44+
match *self {
45+
(t, u) => (u, t),
46+
}
4547
}
4648
}
4749

0 commit comments

Comments
 (0)