mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
Cargo fmt and update a test
This commit is contained in:
parent
0f5dcc665d
commit
16184d3e16
@ -57,8 +57,7 @@ where
|
||||
writer,
|
||||
"<error line=\"{}\" severity=\"warning\" message=\"Should be `{}`\" \
|
||||
/>",
|
||||
mismatch.line_number,
|
||||
message
|
||||
mismatch.line_number, message
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -714,8 +714,7 @@ mod test {
|
||||
toml,
|
||||
format!(
|
||||
"merge_derives = {}\nskip_children = {}\n",
|
||||
merge_derives,
|
||||
skip_children,
|
||||
merge_derives, skip_children,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
20
src/expr.rs
20
src/expr.rs
@ -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
|
||||
))
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user