Merge pull request #2100 from topecongiro/issue-2098

Remove redundant shrink_left
This commit is contained in:
Nick Cameron 2017-10-31 08:24:34 +13:00 committed by GitHub
commit 48fb1139ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 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,

View File

@ -141,3 +141,8 @@ pub enum Entry<'a, K: 'a, V: 'a> {
pub enum ForegroundColor {
CYAN = (winapi::FOREGROUND_INTENSITY | winapi::FOREGROUND_GREEN | winapi::FOREGROUND_BLUE) as u16,
}
// #2098
pub enum E<'a> {
V ( < std::slice::Iter<'a, Xxxxxxxxxxxxxx> as Iterator> :: Item ) ,
}

View File

@ -179,3 +179,8 @@ pub enum ForegroundColor {
CYAN =
(winapi::FOREGROUND_INTENSITY | winapi::FOREGROUND_GREEN | winapi::FOREGROUND_BLUE) as u16,
}
// #2098
pub enum E<'a> {
V(<std::slice::Iter<'a, Xxxxxxxxxxxxxx> as Iterator>::Item),
}