Use correct budget

This commit is contained in:
Seiichi Uchida 2017-10-30 21:35:56 +09:00
parent 271da96098
commit b0d6d03a25
2 changed files with 3 additions and 4 deletions

View file

@ -1235,13 +1235,13 @@ fn format_tuple_struct(
}
result.push(')');
} else {
// 3 = `();`
// 1 = ","
let body = rewrite_call_inner(
context,
"",
&fields.iter().map(|field| field).collect::<Vec<_>>()[..],
span,
Shape::legacy(context.budget(last_line_width(&result) + 3), offset),
Shape::indented(offset, context.config).sub_width(1)?,
context.config.fn_call_width(),
false,
)?;

View file

@ -67,9 +67,8 @@ pub fn rewrite_path(
result.push_str("::");
}
let extra_offset = extra_offset(&result, shape);
// 3 = ">::".len()
let shape = shape.shrink_left(extra_offset)?.sub_width(3)?;
let shape = shape.sub_width(3)?;
result = rewrite_path_segments(
PathContext::Type,