Cargo fmt and update a test

This commit is contained in:
topecongiro 2017-12-01 13:30:21 +09:00 committed by Seiichi Uchida
parent 0f5dcc665d
commit 16184d3e16
8 changed files with 11 additions and 36 deletions

View File

@ -57,8 +57,7 @@ where
writer,
"<error line=\"{}\" severity=\"warning\" message=\"Should be `{}`\" \
/>",
mismatch.line_number,
message
mismatch.line_number, message
)?;
}
}

View File

@ -205,11 +205,7 @@ pub fn combine_strs_with_missing_comments(
};
Some(format!(
"{}{}{}{}{}",
prev_str,
first_sep,
missing_comment,
second_sep,
next_str,
prev_str, first_sep, missing_comment, second_sep, next_str,
))
}

View File

@ -714,8 +714,7 @@ mod test {
toml,
format!(
"merge_derives = {}\nskip_children = {}\n",
merge_derives,
skip_children,
merge_derives, skip_children,
)
);
}

View File

@ -353,10 +353,7 @@ where
if one_line_width <= shape.width {
return Some(format!(
"{}{}{}{}",
lhs_result,
pp.infix,
rhs_result,
pp.suffix
lhs_result, pp.infix, rhs_result, pp.suffix
));
}
}
@ -390,10 +387,7 @@ where
};
Some(format!(
"{}{}{}{}",
lhs_result,
infix_with_sep,
rhs_result,
pp.suffix
lhs_result, infix_with_sep, rhs_result, pp.suffix
))
}
@ -883,10 +877,7 @@ impl<'a> ControlFlow<'a> {
let result = format!(
"{} {} {{ {} }} else {{ {} }}",
self.keyword,
pat_expr_str,
if_str,
else_str
self.keyword, pat_expr_str, if_str, else_str
);
if result.len() <= width {
@ -1589,10 +1580,7 @@ fn rewrite_match_body(
Some(format!(
"{} =>{}{}{}",
pats_str,
block_sep,
body_str,
body_suffix
pats_str, block_sep, body_str, body_suffix
))
};

View File

@ -844,9 +844,7 @@ fn rewrite_trait_ref(
if !(retry && trait_ref_str.contains('\n')) {
return Some(format!(
"{} {}{}",
generics_str,
polarity_str,
&trait_ref_str
generics_str, polarity_str, &trait_ref_str
));
}
}

View File

@ -93,8 +93,7 @@ impl fmt::Display for ErrorKind {
ErrorKind::LineOverflow(found, maximum) => write!(
fmt,
"line exceeded maximum width (maximum: {}, found: {})",
maximum,
found
maximum, found
),
ErrorKind::TrailingWhitespace => write!(fmt, "left behind trailing whitespace"),
ErrorKind::BadIssue(issue) => write!(fmt, "found {}", issue),

View File

@ -442,10 +442,7 @@ impl Rewrite for ast::WherePredicate {
{
format!(
"for< {} > {}{}{}",
lifetime_str,
type_str,
colon,
bounds_str
lifetime_str, type_str, colon, bounds_str
)
} else {
format!("for<{}> {}{}{}", lifetime_str, type_str, colon, bounds_str)

View File

@ -135,8 +135,7 @@ fn issue_1279() {
fn issue_1555() {
let hello = &format!(
"HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
"65454654654654654654654655464",
"4"
"65454654654654654654654655464", "4"
);
}