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

auto-fix if_not_else #13411

Open
Rudxain opened this issue Sep 18, 2024 · 4 comments · May be fixed by #13809
Open

auto-fix if_not_else #13411

Rudxain opened this issue Sep 18, 2024 · 4 comments · May be fixed by #13809

Comments

@Rudxain
Copy link
Contributor

Rudxain commented Sep 18, 2024

Description

Note

I'm unsure if this is a bug-report or feature-request

cargo clippy --fix should swap the 2 blocks

Version

1.81.0

I'm sorry, I'm not using the device that has the tool-chain installed

Additional Labels

No response

@lukaslueg
Copy link
Contributor

@Rudxain, there is no content in your op

@Rudxain
Copy link
Contributor Author

Rudxain commented Sep 19, 2024

no content in your op

I guess it's the new GH Beta Issues. I can see the content

@samueltardieu
Copy link
Contributor

@Rudxain Is it supposed to contain some code?

Image

@Rudxain
Copy link
Contributor Author

Rudxain commented Dec 1, 2024

What I meant is that the example given:

if !v.is_empty() {
    a()
} else {
    b()
}

(and anything of the same form) should be auto-fixable.

Trying to fix it manually is very error-prone for bigger blocks, and git diff doesn't help much either :(

@lapla-cogito lapla-cogito linked a pull request Dec 11, 2024 that will close this issue
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 a pull request may close this issue.

3 participants