mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Add comment on WalkDir vs. fs::read_dir
This commit is contained in:
parent
b61ca63c5e
commit
b5dd8f17d1
1 changed files with 2 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue