rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Alternative option for `match_arm_leading_pipes`?

Open aricursion opened this issue 11 months ago • 0 comments

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?

aricursion avatar Mar 16 '24 18:03 aricursion