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

Remove useless allocation when serializing #144

Merged
merged 1 commit into from Dec 29, 2021
Merged

Remove useless allocation when serializing #144

merged 1 commit into from Dec 29, 2021

Conversation

paolobarbolini
Copy link
Contributor

@paolobarbolini paolobarbolini commented Dec 29, 2021

Replaces Serializer::serialize_str with Serializer::collect_str, which serializes the output of the Display implementation without going through the extra allocation, if the Serializer supports it. For example the serde_json::Serializer supports it

@achanda
Copy link
Owner

@achanda achanda commented Dec 29, 2021

Thanks @paolobarbolini 👍

@achanda achanda merged commit 7120b93 into achanda:master Dec 29, 2021
3 checks passed
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