diff options
| author | Philipp Hansch <dev@phansch.net> | 2018-10-15 21:10:22 +0200 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2018-10-15 21:10:22 +0200 |
| commit | b5dd8f17d12ec6ccc96910c07f930e340fafeb3b (patch) | |
| tree | 261298c1b68a085e5cfc5cfa1b494e6e32e4f205 /clippy_dev | |
| parent | b61ca63c5e91d8659af239e658bf313894aebd23 (diff) | |
| download | rust-b5dd8f17d12ec6ccc96910c07f930e340fafeb3b.tar.gz rust-b5dd8f17d12ec6ccc96910c07f930e340fafeb3b.zip | |
Add comment on WalkDir vs. fs::read_dir
Diffstat (limited to 'clippy_dev')
| -rw-r--r-- | clippy_dev/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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<Item=Lint> { /// Collects all .rs files in the `clippy_lints/src` directory fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> { + // 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()) |
