We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
map_unit_fn
1 parent 7a942a5 commit 488a545Copy full SHA for 488a545
clippy_lints/src/map_unit_fn.rs
@@ -253,14 +253,11 @@ fn lint_map_unit_fn(
253
254
impl<'tcx> LateLintPass<'tcx> for MapUnit {
255
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
+ if let hir::StmtKind::Semi(expr) = stmt.kind
+ && !stmt.span.from_expansion()
+ && let Some(arglists) = method_chain_args(expr, &["map"])
+ {
+ lint_map_unit_fn(cx, stmt, expr, arglists[0]);
264
}
265
266
0 commit comments