Open strega-nil opened 6 years ago
I strongly agree with this! Nested matches get especially painful; I have instances in my work where, with impl/fn
already consuming two indents, a triple match
level adds on another six and I don't get to write actual code until 32 columns in
My personal possibly bad habits about code layout aside, indenting match arm conditions and bodies feels redundant and unnecessarily wasteful to me; they don't both add meaning to rightward drift.
I think a | arm
would provide a visual half-indent and be a nice blend of keeping the interior of the match body indented without costing additional space.
It's a common style in C++ to see:
I would like a similar style to be possible with rustfmt:
or
This would require two configuration options, probably;
|
before each case, and the non-indentation.Thanks!