rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6.06k stars 892 forks source link

`match` indentation broken for tuple-closing brackets #6038

Open a-0-dev opened 10 months ago

a-0-dev commented 10 months ago

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)?

ytmimi commented 10 months ago

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

a-0-dev commented 10 months ago

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! :)