about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Cartwright <caleb.cartwright@outlook.com>2021-07-04 22:26:08 -0500
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>2021-07-25 22:53:32 -0500
commit2cf280ed1ba84001aa4e14152ae37cea18ebcb1c (patch)
treefd3afff997ab3ccc8dff704a89d2d1df9199b97a
parent19733f19f18e2f2a1510667c078c7fc7739b3c54 (diff)
downloadrust-2cf280ed1ba84001aa4e14152ae37cea18ebcb1c.tar.gz
rust-2cf280ed1ba84001aa4e14152ae37cea18ebcb1c.zip
docs: clarify match_arm_blocks config documentation
-rw-r--r--Configurations.md24
1 files changed, 19 insertions, 5 deletions
diff --git a/Configurations.md b/Configurations.md
index 9daa7065379..d2e5613eba9 100644
--- a/Configurations.md
+++ b/Configurations.md
@@ -1475,7 +1475,9 @@ Copyright 2018 The Rust Project Developers.`, etc.:
 
 ## `match_arm_blocks`
 
-Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
+Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.
+
+The Style Guide requires that bodies are block wrapped by default if a line break is required after the `=>`, but this option can be used to disable that behavior to prevent wrapping arm bodies in that event, so long as the body does not contain multiple statements nor line comments.
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
@@ -1486,10 +1488,16 @@ Wrap the body of arms in blocks when it does not fit on the same line with the p
 ```rust
 fn main() {
     match lorem {
-        true => {
+        ipsum => {
             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
         }
-        false => println!("{}", sit),
+        dolor => println!("{}", sit),
+        sit => foo(
+            "foooooooooooooooooooooooo",
+            "baaaaaaaaaaaaaaaaaaaaaaaarr",
+            "baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
+            "qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
+        ),
     }
 }
 ```
@@ -1499,9 +1507,15 @@ fn main() {
 ```rust
 fn main() {
     match lorem {
-        true =>
+        lorem =>
             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
-        false => println!("{}", sit),
+        ipsum => println!("{}", sit),
+        sit => foo(
+            "foooooooooooooooooooooooo",
+            "baaaaaaaaaaaaaaaaaaaaaaaarr",
+            "baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
+            "qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
+        ),
     }
 }
 ```