Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace RawCString with a single function since the main thing it's adding is the implicit .expect on the String -> CString conversion. RawCString and CString otherwise have identical behaviors so the abstraction isn't adding anything AFAICT.
Mark cstr_to_string as unsafe since it's against convention to whitewash the unsafety behind a safe API that wraps the interior with unsafe. The point of unsafe generally is to demarcate "I know at the call site this is actually safe but I can't prove it to the compiler" or "this is a safe abstraction even though internally I have to use unsafe since I can't convince the compiler".
cstr_to_string
falls in the former camp - the function itself isn't a safe abstraction and thus the call-site must be responsible for acknowledging the unsafety.