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

Add as_mut_str() method #124

Merged
merged 1 commit into from
Jun 25, 2022
Merged

Add as_mut_str() method #124

merged 1 commit into from
Jun 25, 2022

Conversation

Kijewski
Copy link
Contributor

String::as_mut_str() returns a mutable slice of its contents. This PR adds the same method to CompactString.

The method is safe, because no safe operation on &mut str can result in a broken UTF-8 string.

`String::as_mut_str()` returns a mutable slice of its contents. This PR
adds the same method to CompactString.

The method is safe, because no safe operation on `&mut str` can result
in a broken UTF-8 string.
@ParkMyCar
Copy link
Owner

Sweet, thanks for the PR! Overall it looks pretty good, but I'll take a closer look soon

Copy link
Owner

@ParkMyCar ParkMyCar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you!

@ParkMyCar ParkMyCar merged commit fe1a7df into ParkMyCar:main Jun 25, 2022
@Kijewski Kijewski deleted the pr-mut-str branch June 25, 2022 14:43
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