core: Make some functions pure
This commit is contained in:
parent
561511e628
commit
844fbd83da
12 changed files with 21 additions and 21 deletions
|
@ -1,14 +1,14 @@
|
|||
fn first<T:copy, U:copy>(pair: (T, U)) -> T {
|
||||
pure fn first<T:copy, U:copy>(pair: (T, U)) -> T {
|
||||
let (t, _) = pair;
|
||||
ret t;
|
||||
}
|
||||
|
||||
fn second<T:copy, U:copy>(pair: (T, U)) -> U {
|
||||
pure fn second<T:copy, U:copy>(pair: (T, U)) -> U {
|
||||
let (_, u) = pair;
|
||||
ret u;
|
||||
}
|
||||
|
||||
fn swap<T:copy, U:copy>(pair: (T, U)) -> (U, T) {
|
||||
pure fn swap<T:copy, U:copy>(pair: (T, U)) -> (U, T) {
|
||||
let (t, u) = pair;
|
||||
ret (u, t);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue