Tsallaka zuwa abun ciki
Justice Tech School

Tuples

A tuple groups values of different types. Access with .0 or destructure.

Example
fn main() {
    let t = ("Ada", 30, 1.68);
    let (n, a, h) = t;
    println!("{} {} {} {}", t.0, n, a, h);
}

Result

Ada Ada 30 1.68

Exercise

Read the first item.

t.

Quiz Test

How do you read tuple items?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.