Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 685 Bytes

File metadata and controls

49 lines (33 loc) · 685 Bytes

Tuple

Example

Execute the following command to run ./solutions/examples/tuple.rs

cargo run --example tuple

Exercises

Exercises are in ./exercises/src/lib.rs

Exercise 1

pub fn first(t: (bool, u32, char)) -> bool {
    todo!();
}

Return the first element in the tuple t.

Exercise 2

pub fn last(t: (bool, u32, char)) -> char {
    todo!();
}

Return the last element in the tuple t.

Exercise 3

pub fn swap(t: (u32, u32)) -> (u32, u32) {
    todo!();
}

Swap the first and second elements of the tuple t.

Test

cargo test