rustlings/exercises/primitive_types/primitive_types5.rs

11 lines
307 B
Rust
Raw Normal View History

2018-11-09 13:31:14 -06:00
// primitive_types5.rs
// Destructure the `cat` tuple so that the println will work.
2022-07-12 07:54:12 -05:00
// Execute `rustlings hint primitive_types5` or use the `hint` watch subcommand for a hint.
2018-11-09 13:31:14 -06:00
fn main() {
let cat = ("Furry McFurson", 3.5);
2023-02-16 11:31:18 -06:00
let (name, age) = cat;
2018-11-09 13:31:14 -06:00
println!("{} is {} years old.", name, age);
}