diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-28 23:37:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-28 23:37:25 +0100 |
commit | ca31b1d63ae91a69f1ce9c0b075403834ba19f38 (patch) | |
tree | df719c1ccd7cbd174b79ca50ffd0052731d1ea86 /crates/ra_hir_ty/src/infer/expr.rs | |
parent | 11f31ae4c3a38831609e4591e751ce10c4e38daf (diff) | |
parent | 36128c170d9d938cfcc52bc851aaed1fab6a2ad9 (diff) |
Merge #5105
5105: Simlify with matches!() r=matklad a=Veetaha
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 6 |
1 files changed, 1 insertions, 5 deletions
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> { | |||
785 | for &check_closures in &[false, true] { | 785 | for &check_closures in &[false, true] { |
786 | let param_iter = param_tys.iter().cloned().chain(repeat(Ty::Unknown)); | 786 | let param_iter = param_tys.iter().cloned().chain(repeat(Ty::Unknown)); |
787 | for (&arg, param_ty) in args.iter().zip(param_iter) { | 787 | for (&arg, param_ty) in args.iter().zip(param_iter) { |
788 | let is_closure = match &self.body[arg] { | 788 | let is_closure = matches!(&self.body[arg], Expr::Lambda { .. }); |
789 | Expr::Lambda { .. } => true, | ||
790 | _ => false, | ||
791 | }; | ||
792 | |||
793 | if is_closure != check_closures { | 789 | if is_closure != check_closures { |
794 | continue; | 790 | continue; |
795 | } | 791 | } |