Skip to content

Commit 24cdb72

Browse files
oli-obklcnr
andcommitted
Use as_closure helper method
Co-authored-by: lcnr <[email protected]>
1 parent 7658e0f commit 24cdb72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/clippy/clippy_lints/src/eta_reduction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
124124
span_lint_and_then(cx, REDUNDANT_CLOSURE, expr.span, "redundant closure", |diag| {
125125
if let Some(mut snippet) = snippet_opt(cx, callee.span) {
126126
if let Some(fn_mut_id) = cx.tcx.lang_items().fn_mut_trait()
127-
&& let args = cx.tcx.erase_late_bound_regions(ty::ClosureSubsts { substs }.sig()).inputs()
127+
&& let args = cx.tcx.erase_late_bound_regions(substs.as_closure().sig()).inputs()
128128
&& implements_trait(cx, callee_ty.peel_refs(), fn_mut_id, &args.iter().copied().map(Into::into).collect::<Vec<_>>())
129129
&& path_to_local(callee).map_or(false, |l| local_used_after_expr(cx, l, expr))
130130
{

0 commit comments

Comments
 (0)