Skip to content

Commit 8ecbb7e

Browse files
committed
fix the lint as requested
1 parent 6b5f275 commit 8ecbb7e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/tools/lint-docs/src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ impl Lint {
3737
}
3838

3939
fn is_ignored(&self) -> bool {
40-
self.doc
41-
.iter()
42-
.filter(|line| line.starts_with("```rust"))
43-
.all(|line| line.contains(",ignore"))
40+
let blocks: Vec<_> = self.doc.iter().filter(|line| line.starts_with("```rust")).collect();
41+
!blocks.is_empty() && blocks.iter().all(|line| line.contains(",ignore"))
4442
}
4543

4644
/// Checks the doc style of the lint.

0 commit comments

Comments
 (0)