Merge commit 'ac0e10aa68' into clippyup

This commit is contained in:
Philipp Krones 2022-10-06 09:44:38 +02:00
parent da16cc1da9
commit d75b25faab
617 changed files with 10259 additions and 4400 deletions

View file

@ -80,12 +80,12 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitWrite {
// used.
let (used, sugg_mac) = if let Some(macro_name) = calling_macro {
(
format!("{}!({}(), ...)", macro_name, dest_name),
format!("{macro_name}!({dest_name}(), ...)"),
macro_name.replace("write", "print"),
)
} else {
(
format!("{}().write_fmt(...)", dest_name),
format!("{dest_name}().write_fmt(...)"),
"print".into(),
)
};
@ -100,9 +100,9 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitWrite {
cx,
EXPLICIT_WRITE,
expr.span,
&format!("use of `{}.unwrap()`", used),
&format!("use of `{used}.unwrap()`"),
"try this",
format!("{}{}!({})", prefix, sugg_mac, inputs_snippet),
format!("{prefix}{sugg_mac}!({inputs_snippet})"),
applicability,
)
}