Skip to content

Not formatting if using if let chained #5512

Description

@afonsolage

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions