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

INT: generalize MatchToIfLetIntention to arbitrary arm count, take two #9424

Merged
merged 1 commit into from Jul 30, 2023

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Sep 28, 2022

This PR is another attempt of implementing #7435.

I learned that if expressions must have an else block if their type is anything other than (). So now the code always generates an else branch if it wasn't already generated by other means for match expressions that don't have unit type.

Fixes: #7409

changelog: The intention to convert a match expression to a series of if let statements is now offered in more situations.

@Kobzol Kobzol added the feature label Sep 28, 2022
@Kobzol Kobzol requested a review from dima74 September 28, 2022 15:25
@Kobzol Kobzol added this to In Progress in To test via automation Sep 28, 2022
@dima74 dima74 self-assigned this Nov 25, 2022
@Kobzol
Copy link
Member Author

Kobzol commented Jul 30, 2023

Rebased. CC @dima74

@vlad20012 vlad20012 assigned vlad20012 and unassigned dima74 Jul 30, 2023
@vlad20012
Copy link
Member

Looks good to me, thank you!

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 30, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 45d1382 into intellij-rust:master Jul 30, 2023
41 of 42 checks passed
To test automation moved this from In Progress to Test Jul 30, 2023
@github-actions github-actions bot added this to the v200 milestone Jul 30, 2023
@Kobzol Kobzol deleted the match-to-if-let-2 branch July 30, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
To test
  
Test
Development

Successfully merging this pull request may close these issues.

Suggest match to if-let intention in more cases
3 participants