Closed as not planned
Description
If rustfmt decides to indent after the =>
in a match (because the line ran too long) it also adds a {}
and an extra line (for the }
) even if the contents of the match arm fit onto a single line.
In the example at rust-bitcoin/rust-bitcoin#959 (comment) rustfmt generated
Error::SerializationError => {
"can not serialize the spending transaction in Transaction::verify()"
},
when it arguably could have (optionally) just stuck with
Error::SerializationError =>
"can not serialize the spending transaction in Transaction::verify()",
unlike ifs (and the C world) you can't get screwed by the lack of {}
here - if you end up with two statements back-to-back its a compile error rather than incorrect logic.
Thanks!