Alternative option for `match_arm_leading_pipes`?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing match_arm_leading_pipes configuration and the formatter logic that handles multi-pattern match arms. Compare its current output with the requested example, then determine how an alternative option should be represented and tested. Done means the option produces the requested line breaks and preserves existing behavior when disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100