mirror of https://github.com/rust-lang/rustlings
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
566 B
Rust
45 lines
566 B
Rust
9 years ago
|
// Destructure the `cat` tuple so that the println will work.
|
||
|
// Scroll down for hints!
|
||
|
|
||
|
fn main() {
|
||
|
let cat = ("Furry McFurson", 3.5);
|
||
|
let /* your pattern here */ = cat;
|
||
|
|
||
|
println!("{} is {} years old.", name, age);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// Take a look at the Primitive Types -> Tuples section of the book:
|
||
|
// http://doc.rust-lang.org/stable/book/primitive-types.html#tuples
|
||
|
// Particularly the part about "destructuring lets". You'll need to
|
||
|
// make a pattern to bind `name` and `age` to the appropriate parts
|
||
|
// of the tuple. You can do it!!
|