You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue seems to be caused by the pipe | before the first alternative which is probably uncommon but legal.
I hoped I could fix the subjectively strange indentation of matches!() where the 2nd to last alternative are indented much more than the first that way. I.e., that's what I get now
I hoped I could fix the subjectively strange indentation of matches!() where the 2nd to last alternative are indented much more than the first that way. I.e., that's what I get now
Support for matches isn't perfect. see #5547 and the other linked issues.
For what it's worth, I've already started work to improve matches! formatting in #5554. I started working on that before the formation of the official style team, so I'll likely need to work with them to make sure the formatting is correct before we move forward.
I also just double checked and the code changes proposed in #5554 produce the following with your first input snippet:
When I format the following code using
rustfmt src/cmds.rs
(with rustfmt 1.5.2-stable (8ede3aa 2023-07-12)) I get invalid code.Original valid code:
Invalid code after formatting:
The issue seems to be caused by the pipe
|
before the first alternative which is probably uncommon but legal.I hoped I could fix the subjectively strange indentation of
matches!()
where the 2nd to last alternative are indented much more than the first that way. I.e., that's what I get nowand what would please me more would be
and by prefixing even the first alternative with a pipe, I would get
which is as aesthetically pleasing as the wished-for version.
The text was updated successfully, but these errors were encountered: