Skip to content

Commit c78cf04

Browse files
author
Michael Wright
committed
Remove unneeded check for method call
The check can be removed because the call to `method_chains_args` already performs this check.
1 parent 183639b commit c78cf04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clippy_lints/src/map_unit_fn.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
250250
}
251251

252252
if let hir::StmtKind::Semi(ref expr, _) = stmt.node {
253-
if let hir::ExprKind::MethodCall(_, _, _) = expr.node {
254-
if let Some(arglists) = method_chain_args(expr, &["map"]) {
255-
lint_map_unit_fn(cx, stmt, expr, arglists[0]);
256-
}
253+
if let Some(arglists) = method_chain_args(expr, &["map"]) {
254+
lint_map_unit_fn(cx, stmt, expr, arglists[0]);
257255
}
258256
}
259257
}

0 commit comments

Comments
 (0)