From f0af1d48187bf19b9f71608ccf18924010438c08 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Mon, 27 Nov 2017 17:49:55 +1300 Subject: [PATCH] Remove CompressedIfEmpty option from fn_args_density It was identical to Tall --- Configurations.md | 31 +--------------- src/config.rs | 4 +-- ...igs-fn_args_density-compressed_if_empty.rs | 20 ----------- ...igs-fn_args_density-compressed_if_empty.rs | 36 ------------------- 4 files changed, 2 insertions(+), 89 deletions(-) delete mode 100644 tests/source/configs-fn_args_density-compressed_if_empty.rs delete mode 100644 tests/target/configs-fn_args_density-compressed_if_empty.rs diff --git a/Configurations.md b/Configurations.md index f155abe63ca..7726193fafe 100644 --- a/Configurations.md +++ b/Configurations.md @@ -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 diff --git a/src/config.rs b/src/config.rs index 1a32b4a9c6c..0f333337bf3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -77,8 +77,6 @@ configuration_option_enum! { Density: Compressed, // Use more lines. Tall, - // Try to compress if the body is empty. - CompressedIfEmpty, // Place every item on a separate line. Vertical, } @@ -95,7 +93,7 @@ impl Density { pub fn to_list_tactic(self) -> ListTactic { match self { Density::Compressed => ListTactic::Mixed, - Density::Tall | Density::CompressedIfEmpty => ListTactic::HorizontalVertical, + Density::Tall => ListTactic::HorizontalVertical, Density::Vertical => ListTactic::Vertical, } } diff --git a/tests/source/configs-fn_args_density-compressed_if_empty.rs b/tests/source/configs-fn_args_density-compressed_if_empty.rs deleted file mode 100644 index 3506ae8ea5c..00000000000 --- a/tests/source/configs-fn_args_density-compressed_if_empty.rs +++ /dev/null @@ -1,20 +0,0 @@ -// rustfmt-fn_args_density: CompressedIfEmpty -// Function arguments density - -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: onsectetur, adipiscing: Adipiscing, elit: Elit); - - // FIXME: Previous line should be formatted like this: - // fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, - // adipiscing: Adipiscing, elit: Elit); - - fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) { - // body - } -} diff --git a/tests/target/configs-fn_args_density-compressed_if_empty.rs b/tests/target/configs-fn_args_density-compressed_if_empty.rs deleted file mode 100644 index 1a0f127f59c..00000000000 --- a/tests/target/configs-fn_args_density-compressed_if_empty.rs +++ /dev/null @@ -1,36 +0,0 @@ -// rustfmt-fn_args_density: CompressedIfEmpty -// Function arguments density - -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: onsectetur, - adipiscing: Adipiscing, - elit: Elit, - ); - - // FIXME: Previous line should be formatted like this: - // fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, - // adipiscing: Adipiscing, elit: Elit); - - fn lorem( - ipsum: Ipsum, - dolor: Dolor, - sit: Sit, - amet: Amet, - consectetur: onsectetur, - adipiscing: Adipiscing, - elit: Elit, - ) { - // body - } -}