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

Not formatting if using if let chained #5512

Closed
afonsolage opened this issue Aug 20, 2022 · 1 comment
Closed

Not formatting if using if let chained #5512

afonsolage opened this issue Aug 20, 2022 · 1 comment

Comments

@afonsolage
Copy link

When using two or more if let chained, rustfmt won't format the code block.

The following code:

fn main() {
    if let Some(()) = Option::default() && let Some(()) = Option::default()
{
                                                }
}

Won't be formatted, as expected:

fn main() {
    if let Some(()) = Option::default() && let Some(()) = Option::default() {}
}

If using a single if let, everything works fine.

Here is a playground example.

@afonsolage
Copy link
Author

nvm, it seems to be already reported on: #5203 (comment)

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

No branches or pull requests

1 participant