Skip to content

Commit a003ca6

Browse files
committed
semicolon_if_nothing_returned now checks if the stmt ends with semicolon
1 parent e8861c8 commit a003ca6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/semicolon_if_nothing_returned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl LateLintPass<'_> for SemicolonIfNothingReturned {
4444
let t_expr = cx.typeck_results().expr_ty(expr);
4545
if t_expr.is_unit();
4646
if let snippet = snippet_with_macro_callsite(cx, expr.span, "}");
47-
if !snippet.ends_with('}');
47+
if !snippet.ends_with('}') && !snippet.ends_with(';');
4848
if cx.sess().source_map().is_multiline(block.span);
4949
then {
5050
// filter out the desugared `for` loop

0 commit comments

Comments
 (0)