Skip to content
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

Merged
merged 4 commits into from Oct 16, 2018

Conversation

Projects
None yet
3 participants
@phansch
Copy link
Collaborator

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 added some commits Oct 9, 2018

Use `WalkDir` to also gather from subdirectories
`fs::read_dir` does not recurse into subdirectories.
@phansch

This comment has been minimized.

Copy link
Collaborator Author

phansch commented Oct 15, 2018

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

fs::read_dir("../clippy_lints/src")
.unwrap()
fn lint_files() -> impl Iterator<Item=walkdir::DirEntry> {
WalkDir::new("../clippy_lints/src")

This comment has been minimized.

@oli-obk

oli-obk Oct 15, 2018

Collaborator

can you add a comment here that we use WalkDir instead of fs::read_dir to recurse into the directories?

This comment has been minimized.

@phansch

phansch Oct 15, 2018

Author Collaborator

yup!

@oli-obk

This comment has been minimized.

Copy link
Collaborator

oli-obk commented Oct 15, 2018

r=me with nit fixed

@phansch

This comment has been minimized.

Copy link
Collaborator Author

phansch commented Oct 15, 2018

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

@mati865

This comment has been minimized.

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 label Oct 16, 2018

@phansch phansch merged commit eb683e6 into rust-lang:master Oct 16, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@phansch phansch deleted the phansch:riir_update_lints_use_walkdir branch Oct 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.