From 8c8d0bb34f5495e0f260b5aaf3685ecb98406f32 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 9 Feb 2020 18:57:01 +0000 Subject: Add or- and parenthesized-patterns --- crates/ra_hir_def/src/expr.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/expr.rs') diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index a75ef9970..5a84e08ed 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs @@ -202,7 +202,7 @@ pub enum Array { #[derive(Debug, Clone, Eq, PartialEq)] pub struct MatchArm { - pub pats: Vec, + pub pat: PatId, pub guard: Option, pub expr: ExprId, } @@ -382,6 +382,7 @@ pub enum Pat { Missing, Wild, Tuple(Vec), + Or(Vec), Record { path: Option, args: Vec, @@ -420,7 +421,7 @@ impl Pat { Pat::Bind { subpat, .. } => { subpat.iter().copied().for_each(f); } - Pat::Tuple(args) | Pat::TupleStruct { args, .. } => { + Pat::Or(args) | Pat::Tuple(args) | Pat::TupleStruct { args, .. } => { args.iter().copied().for_each(f); } Pat::Ref { pat, .. } => f(*pat), -- cgit v1.2.3