-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change InfoType to_str handling for #2.
Remove `Str` enum value, use `VecUchar` instead. Add `to_str_unchecked` method to convert a `VecUchar` into a `CString` including all `nul` characters.
- Loading branch information
Showing
5 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With this implementation I think the approach would be a Python-like one. When you call it, it is best effort and if it fails you deal with it. So you want to make sure you always get a valid
CString
you would do something like:I personally would expect
cl3
do that for me. I seecl3
as Rust abstraction on top of the FFI, which also fixes some low level quirks (like havingnul
s in strings) to make it usable in Rust. An abstraction that just doesn't pass on the quirks from the FFI.