Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative option for match_arm_leading_pipes? #6118

Open
aricursion opened this issue Mar 16, 2024 · 0 comments
Open

Alternative option for match_arm_leading_pipes? #6118

aricursion opened this issue Mar 16, 2024 · 0 comments

Comments

@aricursion
Copy link

aricursion commented Mar 16, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants