diff options
| author | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2016-03-24 14:57:24 +0100 |
|---|---|---|
| committer | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2016-03-24 14:57:24 +0100 |
| commit | 8fd95df54ab5de3dddfd47d8ae9fc52fea803844 (patch) | |
| tree | ab37e6eb43e62a29ac7f06329f42524708659cd2 /src/expr.rs | |
| parent | ca757183fedf8e89286372b91ca074c11d99c4f4 (diff) | |
| parent | 9d8ce544283fd18cf1bfd6285a9dcce19aabbfea (diff) | |
Merge pull request #868 from rust-lang-nursery/tuple-wide
Don't apply the function args heuristic to tuple lits.
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/expr.rs b/src/expr.rs index 5fc0f370ab6..d933f68ce18 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -18,7 +18,7 @@ use std::fmt::Write; use {Indent, Spanned}; use rewrite::{Rewrite, RewriteContext}; use lists::{write_list, itemize_list, ListFormatting, SeparatorTactic, ListTactic, - DefinitiveListTactic, definitive_tactic, ListItem, format_fn_args}; + DefinitiveListTactic, definitive_tactic, ListItem, format_item_list}; use string::{StringFormat, rewrite_string}; use utils::{CodeMapSpanUtils, extra_offset, last_line_width, wrap_str, binary_search, first_line_width, semicolon_for_stmt}; @@ -1336,9 +1336,7 @@ fn rewrite_call_inner<R>(context: &RewriteContext, // Replace the stub with the full overflowing last argument if the rewrite // succeeded and its first line fits with the other arguments. match (overflow_last, tactic, placeholder) { - (true, - DefinitiveListTactic::Horizontal, - placeholder @ Some(..)) => { + (true, DefinitiveListTactic::Horizontal, placeholder @ Some(..)) => { item_vec[arg_count - 1].item = placeholder; } (true, _, _) => { @@ -1511,8 +1509,7 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext, outer_indent)) }; - match (context.config.struct_lit_style, - context.config.struct_lit_multiline_style) { + match (context.config.struct_lit_style, context.config.struct_lit_multiline_style) { (StructLitStyle::Block, _) if fields_str.contains('\n') || fields_str.len() > h_budget => { format_on_newline() } @@ -1583,7 +1580,7 @@ pub fn rewrite_tuple<'a, I>(context: &RewriteContext, list_lo, span.hi - BytePos(1)); let budget = try_opt!(width.checked_sub(2)); - let list_str = try_opt!(format_fn_args(items, budget, indent, context.config)); + let list_str = try_opt!(format_item_list(items, budget, indent, context.config)); Some(format!("({})", list_str)) } |
