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

Feature request: if x.is_some() -> if let Some(_tmp) = x #12977

Closed
vi opened this issue Aug 8, 2022 · 4 comments · Fixed by #15743
Closed

Feature request: if x.is_some() -> if let Some(_tmp) = x #12977

vi opened this issue Aug 8, 2022 · 4 comments · Fixed by #15743
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@vi
Copy link
Contributor

vi commented Aug 8, 2022

Before:

if x.is_┃some() {
    ...
}

After:

if let Some(┃_tmp) = x {
    ...
}
@lnicola lnicola added S-actionable Someone could pick this issue up and work on it right now A-assists C-feature Category: feature request labels Aug 8, 2022
@ice1000
Copy link
Contributor

ice1000 commented Aug 23, 2022

I'll take it, it seems useful

@vi
Copy link
Contributor Author

vi commented Aug 23, 2022

Maybe transformation of if my_result.is_ok() { to if let Ok(_x) = my_result { should be implemented along the way?

@Young-Flash
Copy link
Member

@ice1000 hi, would you like to make it? if you have no time, I'd like to try. seems interesting.

@ice1000
Copy link
Contributor

ice1000 commented Oct 10, 2023

@ice1000 hi, would you like to make it? if you have no time, I'd like to try. seems interesting.

I checked a bit and I found an entire assist too involved. I got too confident about myself after modifying a bit of existing assists. Please give it a shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants