Match multiple patterns

This commit is contained in:
2026-05-19 12:21:20 +02:00
parent 318480f0b5
commit bffc9f073b
4 changed files with 13 additions and 4 deletions
+8 -1
View File
@@ -646,7 +646,14 @@ impl ToRust for Statement {
cg.indent += 1;
for itm in match_items {
cg.add_indentedln(&format!("{} =>", itm.0.get_rust()));
cg.add_indentedln(&format!(
"{} =>",
itm.0
.into_iter()
.map(Pattern::get_rust)
.collect::<Vec<_>>()
.join(" | ")
));
cg.add_indentedln("{");
cg.indent += 1;
itm.1.to_rust(cg);