diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-09-02 09:41:08 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-09-02 09:41:08 +1200 |
| commit | fae93abbdaa9d2bcf7a3c2cff0c5c7beadc62cc7 (patch) | |
| tree | d8d9ff511c50fddd1ca35d23faca0abc722913b5 /src/expr.rs | |
| parent | f81485d9d6a93baf86affbcc60d0ea84bedc3556 (diff) | |
Support struct-like layouts for fn args
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/expr.rs b/src/expr.rs index 20c56ccd34f..19b3693d94b 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -940,10 +940,10 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext, // Foo { a: Foo } - indent is +3, width is -5. let h_budget = try_opt!(width.checked_sub(path_str.len() + 5)); let (indent, v_budget) = match context.config.struct_lit_style { - StructLitStyle::VisualIndent => { + StructLitStyle::Visual => { (offset + path_str.len() + 3, h_budget) } - StructLitStyle::BlockIndent => { + StructLitStyle::Block => { // If we are all on one line, then we'll ignore the indent, and we // have a smaller budget. let indent = context.block_indent + context.config.tab_spaces; @@ -1012,7 +1012,7 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext, let fields_str = write_list(&items.collect::<Vec<_>>(), &fmt); match context.config.struct_lit_style { - StructLitStyle::BlockIndent if fields_str.contains('\n') => { + StructLitStyle::Block if fields_str.contains('\n') => { let inner_indent = make_indent(context.block_indent + context.config.tab_spaces); let outer_indent = make_indent(context.block_indent); Some(format!("{} {{\n{}{}\n{}}}", path_str, inner_indent, fields_str, outer_indent)) @@ -1020,7 +1020,7 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext, _ => Some(format!("{} {{ {} }}", path_str, fields_str)), } - // FIXME if context.config.struct_lit_style == VisualIndent, but we run out + // FIXME if context.config.struct_lit_style == Visual, but we run out // of space, we should fall back to BlockIndent. } |
