Skip to content

Commit

Permalink
fix(utoipa-gen): remove unnecessary allocation with to_string in expa…
Browse files Browse the repository at this point in the history
…nded code (#982)

Remove superfluous allocation via `to_string()` call.
  • Loading branch information
CBenoit authored Aug 5, 2024
1 parent 50dbec1 commit 2088259
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utoipa-gen/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ impl<'p> ToTokensDiagnostics for Path<'p> {
let context_path = context_path.to_token_stream();
let context_path_tokens = quote! {
format!("{}{}",
#context_path.to_string().replace('"', ""),
#path.to_string().replace('"', "")
#context_path.replace('"', ""),
#path.replace('"', "")
)
};
context_path_tokens
})
.unwrap_or_else(|| {
quote! {
#path.to_string().replace('"', "")
#path.replace('"', "")
}
});

Expand Down

0 comments on commit 2088259

Please sign in to comment.