-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RIIR update_lints: use WalkDir instead of read_dir #3320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RIIR update_lints: use WalkDir instead of read_dir #3320
Conversation
`fs::read_dir` does not recurse into subdirectories.
(I was super surprised that |
fs::read_dir("../clippy_lints/src") | ||
.unwrap() | ||
fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> { | ||
WalkDir::new("../clippy_lints/src") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment here that we use WalkDir
instead of fs::read_dir
to recurse into the directories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
r=me with nit fixed |
going to hold off on merging due to hyperium/mime#93 |
@phansch |
We need to traverse into subdirectories in order to collect all lints.
read_dir
doesn't do that andWalkDir
seems like the safest/quickest way to achieve that.cc #2882