diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/expr.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/expr.rs b/src/expr.rs index 066c7faa43e..a2c5f1c077c 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -2080,11 +2080,18 @@ pub fn rewrite_assign_rhs<S: Into<String>>(context: &RewriteContext, 0 }; // 1 = space between operator and rhs. - let max_width = try_opt!(shape.width.checked_sub(last_line_width + 1)); - let rhs = ex.rewrite(context, - Shape::offset(max_width, - shape.indent, - shape.indent.alignment + last_line_width + 1)); + let orig_shape = try_opt!(shape.block_indent(0).offset_left(last_line_width + 1)); + let rhs = match ex.node { + ast::ExprKind::Mac(ref mac) => { + match rewrite_macro(mac, None, context, orig_shape, MacroPosition::Expression) { + None if !context.snippet(ex.span).contains("\n") => { + context.snippet(ex.span).rewrite(context, orig_shape) + } + rhs @ _ => rhs, + } + } + _ => ex.rewrite(context, orig_shape), + }; fn count_line_breaks(src: &str) -> usize { src.chars().filter(|&x| x == '\n').count() |
