Skip to content

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

Merged
merged 4 commits into from
Oct 16, 2018

Conversation

phansch
Copy link
Member

@phansch phansch commented Oct 15, 2018

We need to traverse into subdirectories in order to collect all lints. read_dir doesn't do that and WalkDir seems like the safest/quickest way to achieve that.

cc #2882

@phansch
Copy link
Member Author

phansch commented Oct 15, 2018

(I was super surprised that WalkDir was a straightforward drop-in replacement!)

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 15, 2018
fs::read_dir("../clippy_lints/src")
.unwrap()
fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> {
WalkDir::new("../clippy_lints/src")
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

@oli-obk
Copy link
Contributor

oli-obk commented Oct 15, 2018

r=me with nit fixed

@phansch phansch added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Oct 15, 2018
@phansch
Copy link
Member Author

phansch commented Oct 15, 2018

going to hold off on merging due to hyperium/mime#93

@mati865
Copy link
Contributor

mati865 commented Oct 15, 2018

@phansch mime fix was released just 17 minutes after your comment 😄

@phansch phansch closed this Oct 15, 2018
@phansch phansch reopened this Oct 15, 2018
@phansch phansch removed the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Oct 16, 2018
@phansch phansch merged commit eb683e6 into rust-lang:master Oct 16, 2018
@phansch phansch deleted the riir_update_lints_use_walkdir branch October 16, 2018 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants