rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

`match` indentation broken for tuple-closing brackets

Open a-0-dev opened this issue 1 year ago • 2 comments

The following snippet is formatted using rustfmt.

match Some(1) {
    Some(number) => (
        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        number,
    )
        .to_owned(),
    None => ("test", 0).to_owned(),
};

In my opinion, this is not very readable since it breaks the strict indentation of anything inside a match arm. Shouldn't the closing bracket of the tuple in the Some(_) arm be indented further (and therefore, potentially, the two fields of the tuple as well)?

a-0-dev avatar Jan 22 '24 17:01 a-0-dev

Thanks for the report. I'm pretty sure that this is a duplicate of #6022

ytmimi avatar Jan 22 '24 17:01 ytmimi

You're right. I did search the issue list, but didn't find this one. You may proceed with this issue as you like, if you want to close duplicates please do so! :)

a-0-dev avatar Jan 22 '24 17:01 a-0-dev