Skip to content

Commit 4534b13

Browse files
committed
Fix empty_line_after_outer_attr when a comment follows the attribute.
1 parent 5a50481 commit 4534b13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::It
864864
let lines = snippet.split('\n').collect::<Vec<_>>();
865865
let lines = without_block_comments(lines);
866866

867-
if lines.iter().filter(|l| l.trim().is_empty()).count() > 2 {
867+
if lines.iter().skip(1).filter(|l| l.trim().is_empty()).count() > 1 {
868868
let (lint_msg, lint_type) = match attr.kind {
869869
AttrKind::DocComment(..) => (
870870
"found an empty line after a doc comment. \

0 commit comments

Comments
 (0)