Skip to content

Improvements to match formatting #211

@traviscross

Description

@traviscross

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 an if guard).

cc @rust-lang/style

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions