Improvements to match formatting · Issue #211 · rust-lang/style-team (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
As originally discussed and described in #196 (comment), we want to do the following:
- We want to always break a match arm body onto a new line if the pattern spans multiple lines (and thus always use braces for such a match arm, given the default setting of
match_arm_blocks
). - We want to say that whenever we wrap the
{
to a new line, we always put the=>
on the same line as the{
rather than hanging it on the end of the previous line. In other words, "never break between the=>
and the{
". - We want to break the
=> {
onto a new line if the pattern spans multiple lines and has indented continuation lines (because it has anif
guard).
cc @rust-lang/style