Skip to content
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

Avoid reallocating Strings when creating TarError #269

Merged
merged 1 commit into from Oct 28, 2021
Merged

Avoid reallocating Strings when creating TarError #269

merged 1 commit into from Oct 28, 2021

Conversation

vrmiguel
Copy link
Contributor

@vrmiguel vrmiguel commented Oct 28, 2021

Hello, Alex!

This small PR aims to decrease the overall amount of allocations made in order to instantiate a TarError.

When the description comes from format!, we're able to use that allocation directly and when the description is a string literal we can skip making any new allocation

@alexcrichton alexcrichton merged commit 8333ef6 into alexcrichton:master Oct 28, 2021
@alexcrichton
Copy link
Owner

Seems reasonable, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants