We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f7ccf5e + 126715e commit 24a3123Copy full SHA for 24a3123
guide/expressions.md
@@ -594,6 +594,22 @@ let x = match foo.bar.baz() {
594
595
Use a trailing comma for a match arm if and only if not using a block.
596
597
+Never start a match arm pattern with `|`, e.g.,
598
+
599
+```rust
600
+match foo {
601
+ // Don't do this.
602
+ | foo => bar,
603
+ // Or this.
604
+ | a_very_long_pattern
605
+ | another_pattern
606
+ | yet_another_pattern
607
+ | a_forth_pattern => {
608
+ ...
609
+ }
610
+}
611
+```
612
613
Avoid splitting the left-hand side (before the `=>`) of a match arm where
614
possible. If the right-hand side of the match arm is kept on the same line,
615
never use a block (unless the block is empty).
0 commit comments