]> git.lizzy.rs Git - rust.git/blobdiff - Configurations.md
Merge pull request #2213 from topecongiro/issue-2212
[rust.git] / Configurations.md
index ce0a56b0f1c2f72bbeb77067b5ea6c1a54e27978..7726193fafe24c7ba6a644a9b283ce3445a988f7 100644 (file)
@@ -636,7 +636,7 @@ See also [`comment_width`](#comment_width).
 Argument density in functions
 
 - **Default value**: `"Tall"`
-- **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
+- **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
 
 #### `"Tall"` (default):
 
@@ -696,35 +696,6 @@ trait Lorem {
 }
 ```
 
-#### `"CompressedIfEmpty"`:
-
-```rust
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(
-        ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
-        adipiscing: Adipiscing, elit: Elit,
-    );
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-        consectetur: Consectetur,
-        adipiscing: Adipiscing,
-        elit: Elit,
-    ) {
-        // body
-    }
-}
-```
-
 #### `"Vertical"`:
 
 ```rust
@@ -874,10 +845,9 @@ struct Dolor<T>
 ```
 
 
+## `empty_item_single_line`
 
-## `fn_empty_single_line`
-
-Put empty-body functions on a single line
+Put empty-body functions and impls on a single line
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
@@ -886,6 +856,8 @@ Put empty-body functions on a single line
 
 ```rust
 fn lorem() {}
+
+impl Lorem {}
 ```
 
 #### `false`:
@@ -893,9 +865,12 @@ fn lorem() {}
 ```rust
 fn lorem() {
 }
+
+impl Lorem {
+}
 ```
 
-See also [`control_brace_style`](#control_brace_style).
+See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
 
 
 ## `fn_single_line`
@@ -1004,28 +979,6 @@ fn lorem() -> usize {
 
 See also: [`tab_spaces`](#tab_spaces).
 
-## `impl_empty_single_line`
-
-Put empty-body implementations on a single line
-
-- **Default value**: `true`
-- **Possible values**: `true`, `false`
-
-#### `true` (default):
-
-```rust
-impl Lorem {}
-```
-
-#### `false`:
-
-```rust
-impl Lorem {
-}
-```
-
-See also [`brace_style`](#brace_style).
-
 
 ## `imports_indent`
 
@@ -1108,47 +1061,6 @@ use foo::{aaa,
           fff};
 ```
 
-## `match_arm_forces_newline`
-
-Consistently put match arms (block based or not) in a newline.
-
-- **Default value**: `false`
-- **Possible values**: `true`, `false`
-
-#### `false` (default):
-
-```rust
-match x {
-    // a non-empty block
-    X0 => {
-        f();
-    }
-    // an empty block
-    X1 => {}
-    // a non-block
-    X2 => println!("ok"),
-}
-```
-
-#### `true`:
-
-```rust
-match x {
-    // a non-empty block
-    X0 => {
-        f();
-    }
-    // an empty block
-    X1 =>
-        {}
-    // a non-block
-    X2 => {
-        println!("ok")
-    }
-}
-```
-
-See also: [`wrap_match_arms`](#wrap_match_arms).
 
 ## `match_block_trailing_comma`
 
@@ -1179,7 +1091,7 @@ match lorem {
 }
 ```
 
-See also: [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
+See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_blocks).
 
 ## `max_width`
 
@@ -1213,9 +1125,9 @@ pub enum Foo {}
 pub enum Foo {}
 ```
 
-## `multiline_closure_forces_block`
+## `force_multiline_blocks`
 
-Force multiline closure bodies to be wrapped in a block
+Force multiline closure and match arm bodies to be wrapped in a block
 
 - **Default value**: `false`
 - **Possible values**: `false`, `true`
@@ -1227,6 +1139,13 @@ result.and_then(|maybe_value| match maybe_value {
     None => ...,
     Some(value) => ...,
 })
+
+match lorem {
+    None => if ipsum {
+        println!("Hello World");
+    },
+    Some(dolor) => ...,
+}
 ```
 
 #### `true`:
@@ -1239,29 +1158,7 @@ result.and_then(|maybe_value| {
         Some(value) => ...,
     }
 })
-```
-
-## `multiline_match_arm_forces_block`
-
-Force multiline match arm bodies to be wrapped in a block
 
-- **Default value**: `false`
-- **Possible values**: `false`, `true`
-
-#### `false` (default):
-
-```rust
-match lorem {
-    None => if ipsum {
-        println!("Hello World");
-    },
-    Some(dolor) => ...,
-}
-```
-
-#### `true`:
-
-```rust
 match lorem {
     None => {
         if ipsum {
@@ -1272,6 +1169,7 @@ match lorem {
 }
 ```
 
+
 ## `newline_style`
 
 Unix or Windows line endings
@@ -1861,7 +1759,7 @@ Break comments to fit on the line
 // commodo consequat.
 ```
 
-## `wrap_match_arms`
+## `match_arm_blocks`
 
 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms