Skip to content

Commit d5d8740

Browse files
committed
Rename 'fn_call_style' to 'fn_call_indent'
1 parent 55c2000 commit d5d8740

25 files changed

+31
-31
lines changed

Configurations.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ lorem_ipsum(|| {
298298
});
299299
```
300300

301-
**Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
301+
**Note**: This option only takes effect when `fn_call_indent` is set to `"Visual"`.
302302

303303
## `combine_control_expr`
304304

@@ -758,7 +758,7 @@ where
758758
}
759759
```
760760

761-
## `fn_call_style`
761+
## `fn_call_indent`
762762

763763
Indentation for function calls, etc.
764764

@@ -809,7 +809,7 @@ lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "el
809809

810810
#### Function call longer than `fn_call_width`:
811811

812-
See [`fn_call_style`](#fn_call_style).
812+
See [`fn_call_indent`](#fn_call_indent).
813813

814814
## `fn_empty_single_line`
815815

@@ -874,7 +874,7 @@ fn lorem(ipsum: Ipsum,
874874

875875
```
876876

877-
**Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
877+
**Note**: This option only takes effect when `fn_call_indent` is set to `"Visual"`.
878878

879879
## `fn_single_line`
880880

legacy-rustfmt.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ array_indent = "Visual"
33
control_style = "Legacy"
44
where_style = "Legacy"
55
generics_indent = "Visual"
6-
fn_call_style = "Visual"
6+
fn_call_indent = "Visual"
77
combine_control_expr = false
88
fn_args_paren_newline = true

src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ create_config! {
581581
struct_lit_style: IndentStyle, IndentStyle::Block, false, "Style of struct definition";
582582
struct_lit_multiline_style: MultilineStyle, MultilineStyle::PreferSingle, false,
583583
"Multiline style on literal structs";
584-
fn_call_style: IndentStyle, IndentStyle::Block, false, "Indentation for function calls, etc.";
584+
fn_call_indent: IndentStyle, IndentStyle::Block, false, "Indentation for function calls, etc.";
585585
report_todo: ReportTactic, ReportTactic::Never, false,
586586
"Report all, none or unnumbered occurrences of TODO in source file comments";
587587
report_fixme: ReportTactic, ReportTactic::Never, false,

src/expr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ where
20332033
let used_width = extra_offset(callee_str, shape);
20342034
let one_line_width = shape.width.checked_sub(used_width + 2 * paren_overhead)?;
20352035

2036-
let nested_shape = shape_from_fn_call_style(
2036+
let nested_shape = shape_from_fn_call_indent(
20372037
context,
20382038
shape,
20392039
used_width + 2 * paren_overhead,
@@ -2379,7 +2379,7 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l
23792379
match expr.node {
23802380
ast::ExprKind::Match(..) => {
23812381
(context.use_block_indent() && args_len == 1)
2382-
|| (context.config.fn_call_style() == IndentStyle::Visual && args_len > 1)
2382+
|| (context.config.fn_call_indent() == IndentStyle::Visual && args_len > 1)
23832383
}
23842384
ast::ExprKind::If(..) |
23852385
ast::ExprKind::IfLet(..) |
@@ -2391,7 +2391,7 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l
23912391
}
23922392
ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => {
23932393
context.use_block_indent()
2394-
|| context.config.fn_call_style() == IndentStyle::Visual && args_len > 1
2394+
|| context.config.fn_call_indent() == IndentStyle::Visual && args_len > 1
23952395
}
23962396
ast::ExprKind::Array(..) |
23972397
ast::ExprKind::Call(..) |
@@ -2722,7 +2722,7 @@ pub fn rewrite_field(
27222722
}
27232723
}
27242724

2725-
fn shape_from_fn_call_style(
2725+
fn shape_from_fn_call_indent(
27262726
context: &RewriteContext,
27272727
shape: Shape,
27282728
overhead: usize,

src/rewrite.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'a> RewriteContext<'a> {
4343

4444
/// Return true if we should use block indent style for rewriting function call.
4545
pub fn use_block_indent(&self) -> bool {
46-
self.config.fn_call_style() == IndentStyle::Block || self.use_block
46+
self.config.fn_call_indent() == IndentStyle::Block || self.use_block
4747
}
4848

4949
pub fn budget(&self, used_width: usize) -> usize {

src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ where
357357
},
358358
separator_place: SeparatorPlace::Back,
359359
shape: list_shape,
360-
ends_with_newline: tactic.ends_with_newline(context.config.fn_call_style()),
360+
ends_with_newline: tactic.ends_with_newline(context.config.fn_call_indent()),
361361
preserve_newline: true,
362362
config: context.config,
363363
};

tests/source/big-impl-rfc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-fn_args_indent: Block
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33
// rustfmt-generics_indent: Block
44
// rustfmt-where_style: Rfc
55

tests/source/closure-block-inside-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22

33
// #1547
44
fuzz_target!(|data: &[u8]| if let Some(first) = data.first() {

tests/source/configs-fn_call_style-block-trailing-comma.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-error_on_line_overflow: false
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33

44
// rustfmt should not add trailing comma when rewriting macro. See #1528.
55
fn a() {

tests/source/configs-fn_call_style-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22
// Function call style
33

44
fn main() {

tests/source/configs-fn_call_style-visual-trailing-comma.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-error_on_line_overflow: false
2-
// rustfmt-fn_call_style: Visual
2+
// rustfmt-fn_call_indent: Visual
33

44
// rustfmt should not add trailing comma when rewriting macro. See #1528.
55
fn a() {

tests/source/configs-fn_call_style-visual.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Visual
1+
// rustfmt-fn_call_indent: Visual
22
// Function call style
33

44
fn main() {

tests/source/configs-fn_call_width-zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-fn_call_width: 0
2-
// rustfmt-fn_call_style: block
2+
// rustfmt-fn_call_indent: block
33

44
// #1508
55
fn a() {

tests/source/expr-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-array_indent: Block
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33
// rustfmt-control_style: Rfc
44
// Test expressions with block formatting.
55

tests/target/big-impl-rfc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-fn_args_indent: Block
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33
// rustfmt-generics_indent: Block
44
// rustfmt-where_style: Rfc
55

tests/target/closure-block-inside-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22

33
// #1547
44
fuzz_target!(|data: &[u8]| if let Some(first) = data.first() {

tests/target/configs-combine_control_expr-false.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22
// rustfmt-combine_control_expr: false
33
// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
44

tests/target/configs-combine_control_expr-true.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22
// rustfmt-combine_control_expr: true
33
// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
44

tests/target/configs-fn_call_style-block-tab_spaces-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22
// rustfmt-max_width: 80
33
// rustfmt-tab_spaces: 2
44

tests/target/configs-fn_call_style-block-trailing-comma.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-error_on_line_overflow: false
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33

44
// rustfmt should not add trailing comma when rewriting macro. See #1528.
55
fn a() {

tests/target/configs-fn_call_style-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Block
1+
// rustfmt-fn_call_indent: Block
22
// Function call style
33

44
fn main() {

tests/target/configs-fn_call_style-visual-trailing-comma.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-error_on_line_overflow: false
2-
// rustfmt-fn_call_style: Visual
2+
// rustfmt-fn_call_indent: Visual
33

44
// rustfmt should not add trailing comma when rewriting macro. See #1528.
55
fn a() {

tests/target/configs-fn_call_style-visual.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-fn_call_style: Visual
1+
// rustfmt-fn_call_indent: Visual
22
// Function call style
33

44
fn main() {

tests/target/configs-fn_call_width-zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-fn_call_width: 0
2-
// rustfmt-fn_call_style: block
2+
// rustfmt-fn_call_indent: block
33

44
// #1508
55
fn a() {

tests/target/expr-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rustfmt-array_indent: Block
2-
// rustfmt-fn_call_style: Block
2+
// rustfmt-fn_call_indent: Block
33
// rustfmt-control_style: Rfc
44
// Test expressions with block formatting.
55

0 commit comments

Comments
 (0)