diff options
| author | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2023-07-24 00:18:52 -0400 |
|---|---|---|
| committer | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2023-07-24 00:18:52 -0400 |
| commit | bb1ad0a2f1f07b2c21e6b2bf24013f81dd585a6c (patch) | |
| tree | 74dae85cac2b4e4c3678232963f2ba41589b55de /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 8771282d4e7a5c4569e49d1f878fb3ba90a974d0 (diff) | |
| download | rust-bb1ad0a2f1f07b2c21e6b2bf24013f81dd585a6c.tar.gz rust-bb1ad0a2f1f07b2c21e6b2bf24013f81dd585a6c.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_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 769415b614b..b54cb8c5a0c 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -238,7 +238,7 @@ impl<'a> Parser<'a> { _ => unreachable!(), } .into(); - let invalid = format!("{}=", &sugg); + let invalid = format!("{sugg}="); self.sess.emit_err(errors::InvalidComparisonOperator { span: sp, invalid: invalid.clone(), |
