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

feat: add replace_is_some_with_if_let_some assist #15743

Merged
merged 2 commits into from Oct 12, 2023

Conversation

Young-Flash
Copy link
Member

@Young-Flash Young-Flash commented Oct 11, 2023

This is a basic impl, if it is ok, if my_result.is_ok()-> if let Ok(_x) = my_result ​will be add next.

close #12977

if_is_some_assist

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2023
@HKalbasi
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Oct 12, 2023

📌 Commit 3605bb3 has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 12, 2023

⌛ Testing commit 3605bb3 with merge 84e1d27...

@bors
Copy link
Collaborator

bors commented Oct 12, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing 84e1d27 to master...

@bors bors merged commit 84e1d27 into rust-lang:master Oct 12, 2023
10 checks passed
@Young-Flash
Copy link
Member Author

@HKalbasi hi, I'd like to add if my_result.is_ok() -> if let Ok(_x) = my_result next, the logic is mostly same as this PR, should we make it in a new mod or make them in one mod (probably named as replace_is_xxx_with_if_let_xxx, uh, it's hard to give a proper name)

@HKalbasi
Copy link
Member

Do as you see fit. My weak preference is to have them in a single mod if they can share some code.

@Young-Flash Young-Flash changed the title add replace_is_some_with_if_let_some assist feat: add replace_is_some_with_if_let_some assist Oct 13, 2023
@Young-Flash Young-Flash deleted the replace_is_some_with_if_let_some branch October 13, 2023 06:52
bors added a commit that referenced this pull request Oct 13, 2023
…od, r=HKalbasi

feat: add replace_is_ok_with_if_let_ok assist

following #15743
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.

Feature request: if x.is_some() -> if let Some(_tmp) = x
4 participants