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

fix: Add comma for "move if to guard" #11030

Merged
merged 1 commit into from Dec 16, 2021
Merged

Conversation

weirane
Copy link
Contributor

@weirane weirane commented Dec 15, 2021

As I mentioned in #11017, there is a little issue in the implementation for if branch. This code

let y = match 92 {
    x => {
        if x == 0 {$0
            false
        }
    }
    _ => true,
};

will be transformed to

let y = match 92 {
    x if x == 0 => false
    _ => true,
};

a comma is missing after the false. I moved the fix from the code handling else branch to above.

@Veykril
Copy link
Member

Veykril commented Dec 16, 2021

Thanks!
bors r+

@bors
Copy link
Contributor

bors bot commented Dec 16, 2021

@bors bors bot merged commit f79f3db into rust-lang:master Dec 16, 2021
@weirane weirane deleted the move-if-comma branch December 16, 2021 17:24
@lnicola lnicola changed the title Add comma for "move if to guard" fix: Add comma for "move if to guard" Dec 19, 2021
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 this pull request may close these issues.

None yet

2 participants