From b552eb9e3a01c17f5ecf7679038baa2d0a295940 Mon Sep 17 00:00:00 2001 From: Mattias Wallin Date: Sat, 14 Sep 2024 20:25:30 +0200 Subject: [PATCH] Avoid an allocation in `rewrite_int_lit` --- src/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,