We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce1e211 commit ee4d11fCopy full SHA for ee4d11f
src/libcore/tuple.rs
@@ -22,26 +22,28 @@ pub trait CopyableTuple<T, U> {
22
}
23
24
impl<T:Copy,U:Copy> CopyableTuple<T, U> for (T, U) {
25
-
26
/// Return the first element of self
27
#[inline(always)]
28
fn first(&self) -> T {
29
- let (t, _) = *self;
30
- return t;
+ match *self {
+ (t, _) => t,
+ }
31
32
33
/// Return the second element of self
34
35
fn second(&self) -> U {
36
- let (_, u) = *self;
37
- return u;
+ (_, u) => u,
38
39
40
41
/// Return the results of swapping the two elements of self
42
43
fn swap(&self) -> (U, T) {
- let (t, u) = *self;
44
- return (u, t);
45
+ (t, u) => (u, t),
46
47
48
49
0 commit comments