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

Fix FP of single-element-loop #10162

Merged
merged 2 commits into from
Jan 7, 2023
Merged

Fix FP of single-element-loop #10162

merged 2 commits into from
Jan 7, 2023

Conversation

tamaroning
Copy link
Contributor

@tamaroning tamaroning commented Jan 5, 2023

closes #10018


changelog: [single_element_loop]: No longer lints, if the loop contains a break or continue
#10162

@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2023

r? @flip1995

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 5, 2023
@xFrednet
Copy link
Member

xFrednet commented Jan 7, 2023

r? @xFrednet :)

I wanted to look at the changes anyways to update the changelog entry, and @flip1995 won't mind one review less xD

@rustbot rustbot assigned xFrednet and unassigned flip1995 Jan 7, 2023
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

LGTM, I only have one small suggestion, then we can merge this.

Side note: I wonder if it would make more sense, to simply change the applicability and point out, that the break and continuestatement should be refactored. However, that seems like a lot of effort for little benefit. Some users might even use this pattern to structure their control flow (Even if that might not be ideal). Therefore, I think we should keep this implementation :)

clippy_lints/src/loops/single_element_loop.rs Outdated Show resolved Hide resolved
@tamaroning
Copy link
Contributor Author

@xFrednet thank you for your review. I've finished fixing code.

@xFrednet
Copy link
Member

xFrednet commented Jan 7, 2023

You're welcome, thank you for the swift response. This looks good to me.

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 7, 2023

📌 Commit ce56cf7 has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 7, 2023

⌛ Testing commit ce56cf7 with merge cf1d3d0...

@bors
Copy link
Collaborator

bors commented Jan 7, 2023

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

@bors bors merged commit cf1d3d0 into rust-lang:master Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FP single-element-loop: nested control flow
5 participants