mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-15 06:20:32 +02:00
11 lines
325 B
Rust
11 lines
325 B
Rust
#[rustfmt::skip]
|
|
fn main() {
|
|
let triple = [0, -2, 3];
|
|
println!("Tell me about {triple:?}");
|
|
match triple {
|
|
[0, y, z] => println!("First is 0, y = {y}, and z = {z}"),
|
|
[1, ..] => println!("First is 1 and the rest were ignored"),
|
|
_ => println!("All elements were ignored"),
|
|
}
|
|
}
|