diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2023-07-27 21:35:05 -0500 |
|---|---|---|
| committer | Caleb Cartwright <caleb.cartwright@outlook.com> | 2023-07-27 21:36:06 -0500 |
| commit | 45b2559e5e56157cb1d56f02e52caa33372b1832 (patch) | |
| tree | 1e9dddbd6e7547a8ab7ee80c3592765cc4447d14 | |
| parent | 500647fd8138cc09e87edb08d62f81654fbf6ef8 (diff) | |
| download | rust-45b2559e5e56157cb1d56f02e52caa33372b1832.tar.gz rust-45b2559e5e56157cb1d56f02e52caa33372b1832.zip | |
docs(style-guide): don't flatten match arms with macro call
| -rw-r--r-- | src/doc/style-guide/src/expressions.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md index bf3fe87a0a4..f0c2a189f12 100644 --- a/src/doc/style-guide/src/expressions.md +++ b/src/doc/style-guide/src/expressions.md @@ -663,7 +663,8 @@ never use a block (unless the block is empty). If the right-hand side consists of multiple statements, or has line comments, or the start of the line does not fit on the same line as the left-hand side, -use a block. +use a block. Do not flatten a right-hand side block containing a single macro call +because its expanded form could contain a trailing semicolon. Block-indent the body of a block arm. @@ -686,6 +687,10 @@ match foo { bar => {} // Trailing comma on last item. foo => bar, + baz => qux!(), + lorem => { + ipsum!() + } } ``` |
