Skip to content

handle another type of collapsible if-statement #15027

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Arc8ne
Copy link

@Arc8ne Arc8ne commented Jun 10, 2025

fixes #812


changelog: [collapsible_if]: handle another type of collapsible if-statement

@rustbot
Copy link
Collaborator

rustbot commented Jun 10, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 10, 2025
@rustbot

This comment has been minimized.

@samueltardieu
Copy link
Contributor

I'll take this one as I have already #14906 on my plate.
r? samueltardieu

@rustbot rustbot assigned samueltardieu and unassigned llogiq Jun 10, 2025
@rustbot rustbot 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 Jun 10, 2025
@llogiq llogiq changed the title Resolve #812 by allowing clippy to handle another type of collapsible if-statement handle another type of collapsible if-statement Jun 11, 2025
Arc8ne and others added 2 commits June 16, 2025 18:58
… adhere to standard naming conventions for this project.

Move code for said function out of the `CollapsibleIf` struct's `impl` block.
Refactor code of said function to use `if let` chains instead of early returns.
Add new test case for `collapsible_if` lint with the first condition being a binary operation.
Refactor code to use the `Sugg` interface instead.
@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

  • The following commits have merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

    You can start a rebase with the following commands:

    $ # rebase
    $ git pull --rebase https://github.com/rust-lang/rust-clippy.git master
    $ git push --force-with-lease
    

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Jun 16, 2025
@Arc8ne Arc8ne requested a review from samueltardieu June 16, 2025 11:09
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-merge-commits PR has merge commits, merge with caution. 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.

improve collapsible if in complex cases with same expressions
4 participants