diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2022-11-21 16:52:01 +0100 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-11-21 20:40:26 +0000 |
| commit | 24cdb72445a9ebd545fc5101a6aa8802b5d33c92 (patch) | |
| tree | 1e51cf68ab82405d2d29563047c628d03060ba4d | |
| parent | 7658e0fccf5e01c3950b2f9d7b1fc30a236efcdc (diff) | |
| download | rust-24cdb72445a9ebd545fc5101a6aa8802b5d33c92.tar.gz rust-24cdb72445a9ebd545fc5101a6aa8802b5d33c92.zip | |
Use `as_closure` helper method
Co-authored-by: lcnr <rust@lcnr.de>
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/eta_reduction.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/eta_reduction.rs b/src/tools/clippy/clippy_lints/src/eta_reduction.rs index ea4e5e052d0..f34cbee0355 100644 --- a/src/tools/clippy/clippy_lints/src/eta_reduction.rs +++ b/src/tools/clippy/clippy_lints/src/eta_reduction.rs @@ -124,7 +124,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction { span_lint_and_then(cx, REDUNDANT_CLOSURE, expr.span, "redundant closure", |diag| { if let Some(mut snippet) = snippet_opt(cx, callee.span) { if let Some(fn_mut_id) = cx.tcx.lang_items().fn_mut_trait() - && let args = cx.tcx.erase_late_bound_regions(ty::ClosureSubsts { substs }.sig()).inputs() + && let args = cx.tcx.erase_late_bound_regions(substs.as_closure().sig()).inputs() && implements_trait(cx, callee_ty.peel_refs(), fn_mut_id, &args.iter().copied().map(Into::into).collect::<Vec<_>>()) && path_to_local(callee).map_or(false, |l| local_used_after_expr(cx, l, expr)) { |
