about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/diagnostic_impls.rs
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2023-07-24 00:08:09 -0400
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2023-07-24 00:08:09 -0400
commite36b901933bbd4e747a7eddfbadf23bda93eba02 (patch)
tree8126dbc53c48a963531e61e2dfe0843a1ada5a09 /compiler/rustc_errors/src/diagnostic_impls.rs
parent8771282d4e7a5c4569e49d1f878fb3ba90a974d0 (diff)
downloadrust-e36b901933bbd4e747a7eddfbadf23bda93eba02.tar.gz
rust-e36b901933bbd4e747a7eddfbadf23bda93eba02.zip
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.
Diffstat (limited to 'compiler/rustc_errors/src/diagnostic_impls.rs')
-rw-r--r--compiler/rustc_errors/src/diagnostic_impls.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs
index 10fe7fc74a8..9c972342f25 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -102,7 +102,7 @@ impl IntoDiagnosticArg for bool {
 
 impl IntoDiagnosticArg for char {
     fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
-        DiagnosticArgValue::Str(Cow::Owned(format!("{:?}", self)))
+        DiagnosticArgValue::Str(Cow::Owned(format!("{self:?}")))
     }
 }