Optimize format usage
Per #112156, using `&` in `format!` may cause a small perf delay, so I tried to clean up one module at a time format usage. This PR includes a few removals of the ref in format (they do compile locally without the ref), as well as a few format inlining for consistency.
This commit is contained in:
@@ -279,12 +279,12 @@ pub trait Emitter: Translate {
|
||||
let msg = if substitution.is_empty() || sugg.style.hide_inline() {
|
||||
// This substitution is only removal OR we explicitly don't want to show the
|
||||
// code inline (`hide_inline`). Therefore, we don't show the substitution.
|
||||
format!("help: {}", &msg)
|
||||
format!("help: {msg}")
|
||||
} else {
|
||||
// Show the default suggestion text with the substitution
|
||||
format!(
|
||||
"help: {}{}: `{}`",
|
||||
&msg,
|
||||
msg,
|
||||
if self.source_map().is_some_and(|sm| is_case_difference(
|
||||
sm,
|
||||
substitution,
|
||||
|
||||
Reference in New Issue
Block a user