Skip to content

Add linter for a single element for loop#6109

Merged
bors merged 2 commits into
rust-lang:masterfrom
patrickelectric:single_element_for_check
Oct 25, 2020
Merged

Add linter for a single element for loop#6109
bors merged 2 commits into
rust-lang:masterfrom
patrickelectric:single_element_for_check

Conversation

@patrickelectric

@patrickelectric patrickelectric commented Oct 3, 2020

Copy link
Copy Markdown
Contributor

changelog: Fixes #1540, check for vectors that contain a single element in a for loop

@rust-highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 3, 2020
@patrickelectric patrickelectric force-pushed the single_element_for_check branch 4 times, most recently from e8307d3 to 32cab51 Compare October 3, 2020 20:07
Comment thread clippy_lints/src/loops.rs Outdated
@patrickelectric patrickelectric force-pushed the single_element_for_check branch 3 times, most recently from cb2be56 to 7babff8 Compare October 4, 2020 16:33
@patrickelectric

Copy link
Copy Markdown
Contributor Author

ping @flip1995

1 similar comment
@patrickelectric

Copy link
Copy Markdown
Contributor Author

ping @flip1995

@flip1995

Copy link
Copy Markdown
Member

Sorry for taking so long. I currently have 15 PRs I'm actively reviewing/triaging besides doing other organizational stuff for Clippy. I usually review on weekends, so pinging doesn't really help to speed up my reviews.

@bors

bors commented Oct 10, 2020

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #5727) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Oct 10, 2020

@flip1995 flip1995 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution and welcome to Clippy!

Comment thread tests/ui/single_element_loop.rs
Comment thread clippy_lints/src/loops.rs Outdated
Comment thread clippy_lints/src/loops.rs Outdated
@patrickelectric patrickelectric force-pushed the single_element_for_check branch 5 times, most recently from 58a0cbc to 1a1f347 Compare October 10, 2020 22:02
@patrickelectric

Copy link
Copy Markdown
Contributor Author

Hi @flip1995, sorry for the ping, is just something that I do after a couple of days if a PR does not get a review, but since you mainly review PRs during the weekends I'll stop ping here. Sorry for the bothering!
I just fixed the requested changes and rebased over the current master branch, let me know if anything else is necessary.
Have a great weekend!

Comment thread clippy_lints/src/loops.rs Outdated
Comment thread clippy_lints/src/loops.rs Outdated
Comment thread clippy_lints/src/loops.rs Outdated
Comment thread clippy_lints/src/loops.rs Outdated
Comment thread tests/ui/single_element_loop.rs
@patrickelectric patrickelectric force-pushed the single_element_for_check branch 4 times, most recently from 220a4a6 to 094e0f2 Compare October 17, 2020 21:59
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@patrickelectric patrickelectric force-pushed the single_element_for_check branch from de937ab to ba1ca19 Compare October 19, 2020 12:53
@patrickelectric

Copy link
Copy Markdown
Contributor Author

ping @flip1995

@flip1995

Copy link
Copy Markdown
Member

@bors r+

Thanks!

Sorry for taking so long. I'll start a new job in a new town next month and have little time for reviews currently. I hope it settles down soon and I have more time and energy for Clippy again.

@bors

bors commented Oct 25, 2020

Copy link
Copy Markdown
Contributor

📌 Commit ba1ca19 has been approved by flip1995

@bors

bors commented Oct 25, 2020

Copy link
Copy Markdown
Contributor

⌛ Testing commit ba1ca19 with merge e0e617a...

@bors

bors commented Oct 25, 2020

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing e0e617a to master...

@patrickelectric

Copy link
Copy Markdown
Contributor Author

Hi @flip1995, thank you for the review, I was just a bit worried about the hacktoberfest schedule.
Congratulations for the new job and I hope all is well in the coming weeks!

@flip1995

Copy link
Copy Markdown
Member

IIUC for hacktoberfest only the opening date of the PR is relevant. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint for iterating over a slice with one (or zero) element

5 participants