diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-24 17:47:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-24 17:47:10 +0200 |
| commit | 974a1c242f78ccfb94e43b5c45fc7be501c00d1c (patch) | |
| tree | c8c1bf6a909072195f1272e03ca2d06106f550a6 /compiler/rustc_errors/src/diagnostic_impls.rs | |
| parent | 4d2f98d306c93e53556e86e48d029f774bae79b5 (diff) | |
| parent | e36b901933bbd4e747a7eddfbadf23bda93eba02 (diff) | |
| download | rust-974a1c242f78ccfb94e43b5c45fc7be501c00d1c.tar.gz rust-974a1c242f78ccfb94e43b5c45fc7be501c00d1c.zip | |
Rollup merge of #113993 - nyurik:ref_format_errors, r=WaffleLapkin
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.rs | 2 |
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:?}"))) } } |
