diff --git a/single_file_tests/match.rs b/single_file_tests/match.rs new file mode 100644 index 0000000..8512a44 --- /dev/null +++ b/single_file_tests/match.rs @@ -0,0 +1,10 @@ +fn main() { + let x = ["a", "b", "c", "d"]; + for i in &x { + match *i { + s @ "a" | s @ "b" => println!("IS A or B: {}", s), + s if s == "c" => println!("IS C: {}", s), + s => println!("Others: {}", s), + } + } +} \ No newline at end of file