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

always expect bad c-strings #674

Merged
merged 2 commits into from
Oct 5, 2019
Merged

always expect bad c-strings #674

merged 2 commits into from
Oct 5, 2019

Conversation

r10s
Copy link
Member

@r10s r10s commented Oct 4, 2019

always use to_string_lossy() for converting c-strings to String

the function to_string() is removed;
c-strings may always be badly formatted and this should never lead to a panic.

nb: also scanned over the remaining .to_string() member functions, seems as if .to_string_lossy() is already called where it is needed, eg. for Path or OsString objects.

the function to_string() is removed;
c-strings may always be badly formatted and this should never lead to a panic.
Copy link
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

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

this was discussed also with @dignifiedquire who also agreed it's good to just use to_string_lossy and be done. C-strings come from mime-parsing and mime-generation and it makes sense to not crash on wrong utf8.

@r10s r10s merged commit 187179d into master Oct 5, 2019
@r10s r10s deleted the to-lossy branch October 5, 2019 13:04
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