-
Notifications
You must be signed in to change notification settings - Fork 235
Cstring into Vec or String #639
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
base: main
Are you sure you want to change the base?
Cstring into Vec or String #639
Conversation
zeenix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Co-authored-by: Soso <[email protected]>
zeenix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I promise, last nicpick. :)
Co-authored-by: Zeeshan Ali Khan <[email protected]>
zeenix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I've implemented the methods
into_bytes,into_bytes_with_nul, andinto_string, which are present in thestd::ffi::CString.I've also added
thiserroras a dependency to neatly derive theErrortrait on theIntoStringErrorstruct.If you prefer to keep dependencies to an absolute minimum, I can also remove
thiserrorand implement theErrortrait by hand.