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

api: Add CompactString::into_bytes #258

Merged
merged 3 commits into from
Feb 18, 2023
Merged

api: Add CompactString::into_bytes #258

merged 3 commits into from
Feb 18, 2023

Conversation

ParkMyCar
Copy link
Owner

This PR adds a new API CompactString::into_bytes which consumes a CompactString, returning a byte vector, just like the String::into_bytes method.

A difference though is CompactString::into_bytes returns a SmallVec which allows us to avoid needing to allocate, by re-using the underlying buffer from the CompactString

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.

1 participant