We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b0122b commit 3ce3569Copy full SHA for 3ce3569
clippy_lints/src/empty_docs.rs
@@ -41,20 +41,17 @@ fn trim_comment(comment: &str) -> String {
41
42
impl EarlyLintPass for EmptyDocs {
43
fn check_attribute(&mut self, cx: &EarlyContext<'_>, attribute: &Attribute) {
44
- match attribute.kind {
45
- AttrKind::DocComment(_line, comment) => {
46
- if trim_comment(comment.as_str()).len() == 0 {
47
- span_lint_and_help(
48
- cx,
49
- EMPTY_DOCS,
50
- attribute.span,
51
- "empty doc comment",
52
- None,
53
- "consider removing or fill it",
54
- );
55
- }
56
- },
57
- _ => {},
+ if let AttrKind::DocComment(_line, comment) = attribute.kind {
+ if trim_comment(comment.as_str()).len() == 0 {
+ span_lint_and_help(
+ cx,
+ EMPTY_DOCS,
+ attribute.span,
+ "empty doc comment",
+ None,
+ "consider removing or fill it",
+ );
+ }
58
}
59
60
0 commit comments