1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-02-05 10:44:17 +02:00

11 lines
325 B
Rust
Raw Normal View History

2022-12-21 16:36:30 +01:00
#[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"),
}
}