Rename 'fn_call_style' to 'fn_call_indent'

This commit is contained in:
topecongiro 2017-11-04 22:46:40 +09:00
parent 55c2000d94
commit d5d8740993
25 changed files with 31 additions and 31 deletions

View File

@ -298,7 +298,7 @@ lorem_ipsum(|| {
});
```
**Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
**Note**: This option only takes effect when `fn_call_indent` is set to `"Visual"`.
## `combine_control_expr`
@ -758,7 +758,7 @@ where
}
```
## `fn_call_style`
## `fn_call_indent`
Indentation for function calls, etc.
@ -809,7 +809,7 @@ lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "el
#### Function call longer than `fn_call_width`:
See [`fn_call_style`](#fn_call_style).
See [`fn_call_indent`](#fn_call_indent).
## `fn_empty_single_line`
@ -874,7 +874,7 @@ fn lorem(ipsum: Ipsum,
```
**Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
**Note**: This option only takes effect when `fn_call_indent` is set to `"Visual"`.
## `fn_single_line`

View File

@ -3,6 +3,6 @@ array_indent = "Visual"
control_style = "Legacy"
where_style = "Legacy"
generics_indent = "Visual"
fn_call_style = "Visual"
fn_call_indent = "Visual"
combine_control_expr = false
fn_args_paren_newline = true

View File

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

View File

@ -2033,7 +2033,7 @@ where
let used_width = extra_offset(callee_str, shape);
let one_line_width = shape.width.checked_sub(used_width + 2 * paren_overhead)?;
let nested_shape = shape_from_fn_call_style(
let nested_shape = shape_from_fn_call_indent(
context,
shape,
used_width + 2 * paren_overhead,
@ -2379,7 +2379,7 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l
match expr.node {
ast::ExprKind::Match(..) => {
(context.use_block_indent() && args_len == 1)
|| (context.config.fn_call_style() == IndentStyle::Visual && args_len > 1)
|| (context.config.fn_call_indent() == IndentStyle::Visual && args_len > 1)
}
ast::ExprKind::If(..) |
ast::ExprKind::IfLet(..) |
@ -2391,7 +2391,7 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l
}
ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => {
context.use_block_indent()
|| context.config.fn_call_style() == IndentStyle::Visual && args_len > 1
|| context.config.fn_call_indent() == IndentStyle::Visual && args_len > 1
}
ast::ExprKind::Array(..) |
ast::ExprKind::Call(..) |
@ -2722,7 +2722,7 @@ pub fn rewrite_field(
}
}
fn shape_from_fn_call_style(
fn shape_from_fn_call_indent(
context: &RewriteContext,
shape: Shape,
overhead: usize,

View File

@ -43,7 +43,7 @@ impl<'a> RewriteContext<'a> {
/// Return true if we should use block indent style for rewriting function call.
pub fn use_block_indent(&self) -> bool {
self.config.fn_call_style() == IndentStyle::Block || self.use_block
self.config.fn_call_indent() == IndentStyle::Block || self.use_block
}
pub fn budget(&self, used_width: usize) -> usize {

View File

@ -357,7 +357,7 @@ where
},
separator_place: SeparatorPlace::Back,
shape: list_shape,
ends_with_newline: tactic.ends_with_newline(context.config.fn_call_style()),
ends_with_newline: tactic.ends_with_newline(context.config.fn_call_indent()),
preserve_newline: true,
config: context.config,
};

View File

@ -1,5 +1,5 @@
// rustfmt-fn_args_indent: Block
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-generics_indent: Block
// rustfmt-where_style: Rfc

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// #1547
fuzz_target!(|data: &[u8]| if let Some(first) = data.first() {

View File

@ -1,5 +1,5 @@
// rustfmt-error_on_line_overflow: false
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt should not add trailing comma when rewriting macro. See #1528.
fn a() {

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// Function call style
fn main() {

View File

@ -1,5 +1,5 @@
// rustfmt-error_on_line_overflow: false
// rustfmt-fn_call_style: Visual
// rustfmt-fn_call_indent: Visual
// rustfmt should not add trailing comma when rewriting macro. See #1528.
fn a() {

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Visual
// rustfmt-fn_call_indent: Visual
// Function call style
fn main() {

View File

@ -1,5 +1,5 @@
// rustfmt-fn_call_width: 0
// rustfmt-fn_call_style: block
// rustfmt-fn_call_indent: block
// #1508
fn a() {

View File

@ -1,5 +1,5 @@
// rustfmt-array_indent: Block
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-control_style: Rfc
// Test expressions with block formatting.

View File

@ -1,5 +1,5 @@
// rustfmt-fn_args_indent: Block
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-generics_indent: Block
// rustfmt-where_style: Rfc

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// #1547
fuzz_target!(|data: &[u8]| if let Some(first) = data.first() {

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-combine_control_expr: false
// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-combine_control_expr: true
// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-max_width: 80
// rustfmt-tab_spaces: 2

View File

@ -1,5 +1,5 @@
// rustfmt-error_on_line_overflow: false
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt should not add trailing comma when rewriting macro. See #1528.
fn a() {

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// Function call style
fn main() {

View File

@ -1,5 +1,5 @@
// rustfmt-error_on_line_overflow: false
// rustfmt-fn_call_style: Visual
// rustfmt-fn_call_indent: Visual
// rustfmt should not add trailing comma when rewriting macro. See #1528.
fn a() {

View File

@ -1,4 +1,4 @@
// rustfmt-fn_call_style: Visual
// rustfmt-fn_call_indent: Visual
// Function call style
fn main() {

View File

@ -1,5 +1,5 @@
// rustfmt-fn_call_width: 0
// rustfmt-fn_call_style: block
// rustfmt-fn_call_indent: block
// #1508
fn a() {

View File

@ -1,5 +1,5 @@
// rustfmt-array_indent: Block
// rustfmt-fn_call_style: Block
// rustfmt-fn_call_indent: Block
// rustfmt-control_style: Rfc
// Test expressions with block formatting.