From 95c8c65139c10e4de44367fead8dff88511e6d46 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 17 Jun 2021 17:37:14 +0200 Subject: Nest all the or-patterns! --- crates/hir_ty/src/infer/pat.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/hir_ty/src/infer/pat.rs') diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 035f4ded6..58cb23e9d 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -297,10 +297,11 @@ fn is_non_ref_pat(body: &hir_def::body::Body, pat: PatId) -> bool { Expr::Literal(Literal::String(..)) => false, _ => true, }, - Pat::Bind { mode: BindingAnnotation::Mutable, subpat: Some(subpat), .. } - | Pat::Bind { mode: BindingAnnotation::Unannotated, subpat: Some(subpat), .. } => { - is_non_ref_pat(body, *subpat) - } + Pat::Bind { + mode: BindingAnnotation::Mutable | BindingAnnotation::Unannotated, + subpat: Some(subpat), + .. + } => is_non_ref_pat(body, *subpat), Pat::Wild | Pat::Bind { .. } | Pat::Ref { .. } | Pat::Box { .. } | Pat::Missing => false, } } -- cgit v1.2.3