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 | eb850aef96ed1914a82feb1e297a6c9f5b71cae3 (patch) | |
| tree | e4c7fb4c59532e50eb1996efbd4921276bf23072 | |
| parent | 595ae838558f767a4d54b1c69843f6c53314ebc9 (diff) | |
| download | rust-eb850aef96ed1914a82feb1e297a6c9f5b71cae3.tar.gz rust-eb850aef96ed1914a82feb1e297a6c9f5b71cae3.zip | |
Use `as_closure` helper method
Co-authored-by: lcnr <rust@lcnr.de>
| -rw-r--r-- | clippy_lints/src/eta_reduction.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index ea4e5e052d0..f34cbee0355 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/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)) { |
