-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: replace format! with concat! for string literals #2695
base: master
Are you sure you want to change the base?
Conversation
ae880a1
to
f436479
Compare
I think the format macro already optimizes static strings (like the |
They are different. |
Read the link I wrote. |
@ricvelozo I have read your link, it says |
Like I said in the review, you are using the ToString trait, and that allocates. |
f436479
to
a398ae1
Compare
@ricvelozo I have just removed the change that involves |
Nice! 👍🏻 |
@ricvelozo Could you please approve the workflow run? |
Needs Héctor's approval. Eventually he will review. |
All these usecases convert the given input into a |
format!
macro is very powerful, it introduces overhead of memory allocation on the heap compared to&str
. Therefore, whenformat!
macro is unnecessary, we should avoid using it.