diff options
| author | Evan Typanski <evantypanski@gmail.com> | 2022-09-30 11:36:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-30 11:36:55 -0400 |
| commit | 85b8ff7f38149caefd60fd79dc156dc3d18c3c7c (patch) | |
| tree | dac9be82eca2779ed4792c3643e2d3dfdce670a2 | |
| parent | 416da1264c48aa38c6ae8c6f6aefffa49ae3b21f (diff) | |
| download | rust-85b8ff7f38149caefd60fd79dc156dc3d18c3c7c.tar.gz rust-85b8ff7f38149caefd60fd79dc156dc3d18c3c7c.zip | |
Fix style in `if let` chain
Co-authored-by: Alex Macleod <alex@macleod.io>
| -rw-r--r-- | clippy_lints/src/eta_reduction.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index a5c6512a5e7..3732410e71e 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -122,9 +122,10 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction { then { 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() && - implements_trait(cx, callee_ty.peel_refs(), fn_mut_id, &[]) && - path_to_local(callee).map_or(false, |l| local_used_after_expr(cx, l, expr)) { + if let Some(fn_mut_id) = cx.tcx.lang_items().fn_mut_trait() + && implements_trait(cx, callee_ty.peel_refs(), fn_mut_id, &[]) + && path_to_local(callee).map_or(false, |l| local_used_after_expr(cx, l, expr)) + { // Mutable closure is used after current expr; we cannot consume it. snippet = format!("&mut {snippet}"); } |
