Use vertical layout when args len is larger than fn_call_width

This commit is contained in:
topecongiro 2017-05-12 16:30:26 +09:00
parent 88250c4af2
commit 384ce46eef
4 changed files with 21 additions and 2 deletions

View File

@ -1784,7 +1784,8 @@ fn rewrite_call_args(context: &RewriteContext,
// and not rewriting macro. // and not rewriting macro.
Some(ref s) if context.config.fn_call_style == IndentStyle::Block && Some(ref s) if context.config.fn_call_style == IndentStyle::Block &&
!force_no_trailing_comma && !force_no_trailing_comma &&
(!s.contains('\n') && s.len() > one_line_width) => { (!s.contains('\n') &&
(s.len() > one_line_width || s.len() > context.config.fn_call_width)) => {
fmt.trailing_separator = SeparatorTactic::Vertical; fmt.trailing_separator = SeparatorTactic::Vertical;
write_list(&item_vec, &fmt) write_list(&item_vec, &fmt)
} }

View File

@ -0,0 +1,7 @@
// rustfmt-fn_call_width: 0
// rustfmt-fn_call_style: block
// #1508
fn a() {
let x = f(y);
}

View File

@ -13,7 +13,9 @@ fn main() {
"elit", "elit",
); );
// #1501 // #1501
let hyper = Arc::new(Client::with_connector(HttpsConnector::new(TlsClient::new()))); let hyper = Arc::new(
Client::with_connector(HttpsConnector::new(TlsClient::new())),
);
} }
// #1521 // #1521

View File

@ -0,0 +1,9 @@
// rustfmt-fn_call_width: 0
// rustfmt-fn_call_style: block
// #1508
fn a() {
let x = f(
y,
);
}