From b5dd8f17d12ec6ccc96910c07f930e340fafeb3b Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 15 Oct 2018 21:10:22 +0200 Subject: [PATCH] Add comment on WalkDir vs. fs::read_dir --- clippy_dev/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 1bd9bffff06..8477183ae56 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -93,6 +93,8 @@ fn parse_contents(content: &str, filename: &str) -> impl Iterator { /// Collects all .rs files in the `clippy_lints/src` directory fn lint_files() -> impl Iterator { + // We use `WalkDir` instead of `fs::read_dir` here in order to recurse into subdirectories. + // Otherwise we would not collect all the lints, for example in `clippy_lints/src/methods/`. WalkDir::new("../clippy_lints/src") .into_iter() .filter_map(|f| f.ok())