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

Use Serializer::collect_str to serialize output of Display #39

Merged
merged 1 commit into from
Mar 27, 2023
Merged

Use Serializer::collect_str to serialize output of Display #39

merged 1 commit into from
Mar 27, 2023

Conversation

paolobarbolini
Copy link
Contributor

Serializer::collect_str is exactly the same as doing Serializer::serialize_str(&thing_to_serialize.to_string()), but some Serializer implementations, for example the serde_json Serializer, avoid the allocation made by ToString and serialize the item in place

@krisprice
Copy link
Owner

Hi @paolobarbolini - so this is just an efficiency improvement? Functionally nothing changes right? I'll include it on the next release in that case, sorry I missed it this time around.

@paolobarbolini
Copy link
Contributor Author

Yeah it's only an efficiency improvement and nothing changes in the funtcionally

@krisprice krisprice merged commit 1096c55 into krisprice:master Mar 27, 2023
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.

2 participants