You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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!
The text was updated successfully, but these errors were encountered:
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
when it arguably could have (optionally) just stuck with
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!
The text was updated successfully, but these errors were encountered: