Break chains that don't start with path expressions
This commit is contained in:
parent
a53be86710
commit
749a9689be
6 changed files with 56 additions and 66 deletions
12
src/expr.rs
12
src/expr.rs
|
@ -40,15 +40,6 @@ impl Rewrite for ast::Expr {
|
|||
}
|
||||
}
|
||||
ast::Expr_::ExprCall(ref callee, ref args) => {
|
||||
// // FIXME using byte lens instead of char lens (and probably all over the place too)
|
||||
// // 2 is for parens
|
||||
// let max_callee_width = try_opt!(width.checked_sub(2));
|
||||
// let callee_str = try_opt!(callee.rewrite(context, max_callee_width, offset));
|
||||
|
||||
// let new_span = mk_sp(callee.span.hi, self.span.hi);
|
||||
// let lo = span_after(new_span, "(", context.codemap);
|
||||
// let new_span = mk_sp(lo, self.span.hi);
|
||||
|
||||
rewrite_call(context, &**callee, args, self.span, width, offset)
|
||||
}
|
||||
ast::Expr_::ExprParen(ref subexpr) => {
|
||||
|
@ -927,6 +918,9 @@ fn rewrite_call_inner<R>(context: &RewriteContext,
|
|||
None => return Err(Ordering::Greater),
|
||||
};
|
||||
|
||||
let span_lo = span_after(span, "(", context.codemap);
|
||||
let span = mk_sp(span_lo, span.hi);
|
||||
|
||||
let extra_offset = extra_offset(&callee_str, offset);
|
||||
// 2 is for parens.
|
||||
let remaining_width = match width.checked_sub(extra_offset + 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue