From e75e2ae5b6b6b1364368ceb3d4081b6508b2f001 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 28 Jun 2020 04:02:03 +0300 Subject: Simlify with matches!() --- crates/ra_hir_ty/src/infer/expr.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/ra_hir_ty/src/infer/expr.rs') diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 61af5f064..22884522a 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs @@ -785,11 +785,7 @@ impl<'a> InferenceContext<'a> { for &check_closures in &[false, true] { let param_iter = param_tys.iter().cloned().chain(repeat(Ty::Unknown)); for (&arg, param_ty) in args.iter().zip(param_iter) { - let is_closure = match &self.body[arg] { - Expr::Lambda { .. } => true, - _ => false, - }; - + let is_closure = matches!(&self.body[arg], Expr::Lambda { .. }); if is_closure != check_closures { continue; } -- cgit v1.2.3