Skip to content

Commit d00c60d

Browse files
committed
Remove chain_split_single_child option
1 parent 4cb474b commit d00c60d

5 files changed

+1
-35
lines changed

Configurations.md

-21
Original file line numberDiff line numberDiff line change
@@ -440,27 +440,6 @@ let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
440440
#### Lines longer than `chain_width`:
441441
See [`chain_indent`](#chain_indent).
442442

443-
## `chain_split_single_child`
444-
445-
Split a chain with a single child if its length exceeds [`chain_width`](#chain_width).
446-
447-
- **Default value**: `false`
448-
- **Possible values**: `false`, `true`
449-
450-
#### `false` (default):
451-
452-
```rust
453-
let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
454-
```
455-
456-
#### `true`:
457-
458-
```rust
459-
let files = fs::read_dir("tests/coverage/source")
460-
.expect("Couldn't read source dir");
461-
```
462-
463-
See also [`chain_width`](#chain_width).
464443

465444
## `combine_control_expr`
466445

src/chains.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
158158
} else {
159159
rewrites.iter().fold(0, |a, b| a + b.len()) + parent_rewrite.len()
160160
} + suffix_try_num;
161-
let one_line_budget = if rewrites.is_empty() && !context.config.chain_split_single_child() {
161+
let one_line_budget = if rewrites.is_empty() {
162162
shape.width
163163
} else {
164164
min(shape.width, context.config.chain_width())

src/config.rs

-2
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,6 @@ create_config! {
570570
report_fixme: ReportTactic, ReportTactic::Never, false,
571571
"Report all, none or unnumbered occurrences of FIXME in source file comments";
572572
chain_width: usize, 60, false, "Maximum length of a chain to fit on a single line";
573-
chain_split_single_child: bool, false, false, "Split a chain with a single child if its length \
574-
exceeds `chain_width`";
575573
imports_indent: IndentStyle, IndentStyle::Visual, false, "Indent of imports";
576574
imports_layout: ListTactic, ListTactic::Mixed, false, "Item layout inside a import block";
577575
reorder_extern_crates: bool, true, false, "Reorder extern crate statements alphabetically";

tests/target/configs-chain_split_single_child-false.rs

-5
This file was deleted.

tests/target/configs-chain_split_single_child-true.rs

-6
This file was deleted.

0 commit comments

Comments
 (0)