Skip to content

Alternative option for match_arm_leading_pipes? #6118

Open
@zaxioms0

Description

@zaxioms0

I would really like an option for match_arm_leading_pipes which only forces matches to the same branch onto new lines with a pipe. For example:

match foo {
    aaa => ()
    bbb | ccc | ddd => ()
    eee => ()
} 

becomes

match foo {
    aaa => ()
    bbb
    | ccc 
    | ddd => ()
    eee => ()
} 

I personally like this change because it prevents overly-cramped long multi-match arms while also making it clear which "blocks" correspond to which arms. Is this possible already? If not, could someone point me in the right direction for adding a PR?

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