Skip to content

Commit b552eb9

Browse files
Rawkytmimi
authored andcommitted
Avoid an allocation in rewrite_int_lit
1 parent 008b3df commit b552eb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ fn rewrite_int_lit(
13301330
format!(
13311331
"0x{}{}",
13321332
hex_lit,
1333-
token_lit.suffix.map_or(String::new(), |s| s.to_string())
1333+
token_lit.suffix.as_ref().map_or("", |s| s.as_str())
13341334
),
13351335
context.config.max_width(),
13361336
shape,

0 commit comments

Comments
 (0)