Skip to content

Commit b5dd8f1

Browse files
committed
Add comment on WalkDir vs. fs::read_dir
1 parent b61ca63 commit b5dd8f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_dev/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ fn parse_contents(content: &str, filename: &str) -> impl Iterator<Item=Lint> {
9393

9494
/// Collects all .rs files in the `clippy_lints/src` directory
9595
fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> {
96+
// We use `WalkDir` instead of `fs::read_dir` here in order to recurse into subdirectories.
97+
// Otherwise we would not collect all the lints, for example in `clippy_lints/src/methods/`.
9698
WalkDir::new("../clippy_lints/src")
9799
.into_iter()
98100
.filter_map(|f| f.ok())

0 commit comments

Comments
 (0)