Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/expr.rs')
| -rw-r--r-- | crates/hir-ty/src/infer/expr.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs index d4b6999614..a655d1614a 100644 --- a/crates/hir-ty/src/infer/expr.rs +++ b/crates/hir-ty/src/infer/expr.rs @@ -276,7 +276,7 @@ impl InferenceContext<'_> { // Now go through the argument patterns for (arg_pat, arg_ty) in args.iter().zip(&sig_tys) { - self.infer_top_pat(*arg_pat, &arg_ty); + self.infer_top_pat(*arg_pat, arg_ty); } // FIXME: lift these out into a struct @@ -1081,8 +1081,7 @@ impl InferenceContext<'_> { let inner_exp = expected .to_option(table) .as_ref() - .map(|e| e.as_adt()) - .flatten() + .and_then(|e| e.as_adt()) .filter(|(e_adt, _)| e_adt == &box_id) .map(|(_, subts)| { let g = subts.at(Interner, 0); @@ -1320,7 +1319,7 @@ impl InferenceContext<'_> { .unwrap_or_else(|| this.table.new_type_var()); let ty = if let Some(expr) = initializer { - let ty = if contains_explicit_ref_binding(&this.body, *pat) { + let ty = if contains_explicit_ref_binding(this.body, *pat) { this.infer_expr(*expr, &Expectation::has_type(decl_ty.clone())) } else { this.infer_expr_coerce( @@ -1716,7 +1715,7 @@ impl InferenceContext<'_> { // that we have more information about the types of arguments when we // type-check the functions. This isn't really the right way to do this. for check_closures in [false, true] { - let mut skip_indices = skip_indices.into_iter().copied().fuse().peekable(); + let mut skip_indices = skip_indices.iter().copied().fuse().peekable(); let param_iter = param_tys.iter().cloned().chain(repeat(self.err_ty())); let expected_iter = expected_inputs .iter() |