[Rust] Accessing specific values in a tuple by index
fn main() {
let cat = ("Furry McFurson", 3.5);
let (name, age) = cat;
println!("{} is {} years old.", name, age);
}
Example 2:
#[test]
fn indexing_tuple() {
let numbers = (1, 2, 3);
let second = numbers.1;
assert_eq!(2, second,
"This is not the 2nd number in the tuple!")
}