Skip to content

Commit 488a545

Browse files
committed
map_unit_fn: Delay macro check
1 parent 7a942a5 commit 488a545

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

clippy_lints/src/map_unit_fn.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,11 @@ fn lint_map_unit_fn(
253253

254254
impl<'tcx> LateLintPass<'tcx> for MapUnit {
255255
fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &hir::Stmt<'_>) {
256-
if stmt.span.from_expansion() {
257-
return;
258-
}
259-
260-
if let hir::StmtKind::Semi(expr) = stmt.kind {
261-
if let Some(arglists) = method_chain_args(expr, &["map"]) {
262-
lint_map_unit_fn(cx, stmt, expr, arglists[0]);
263-
}
256+
if let hir::StmtKind::Semi(expr) = stmt.kind
257+
&& !stmt.span.from_expansion()
258+
&& let Some(arglists) = method_chain_args(expr, &["map"])
259+
{
260+
lint_map_unit_fn(cx, stmt, expr, arglists[0]);
264261
}
265262
}
266263
}

0 commit comments

Comments
 (0)