diff options
| author | Mattias Wallin <mattias@klingawallin.se> | 2024-09-14 20:25:30 +0200 |
|---|---|---|
| committer | Yacin Tmimi <yacintmimi@gmail.com> | 2024-09-17 12:42:33 -0400 |
| commit | b552eb9e3a01c17f5ecf7679038baa2d0a295940 (patch) | |
| tree | 52cc1bd401762d13972f96a0f99615ebfb38e879 | |
| parent | 008b3df97d430f12d0b7dbdebacc048d1aa0666f (diff) | |
| download | rust-b552eb9e3a01c17f5ecf7679038baa2d0a295940.tar.gz rust-b552eb9e3a01c17f5ecf7679038baa2d0a295940.zip | |
Avoid an allocation in `rewrite_int_lit`
| -rw-r--r-- | src/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.rs b/src/expr.rs index d6646d48d3e..77c9818b66b 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1330,7 +1330,7 @@ fn rewrite_int_lit( format!( "0x{}{}", hex_lit, - token_lit.suffix.map_or(String::new(), |s| s.to_string()) + token_lit.suffix.as_ref().map_or("", |s| s.as_str()) ), context.config.max_width(), shape, |
