Re:Rust FFI: Sending strings to the outside world
by Michael-F-Bryan on Thursday May 18, 2017 @03:34AM
(#14365465)
I'd recommend against using `std::mem::forget`. Even though it does pretty much the same thing you should probably use `some_cstring.into_raw()` instead. Semantically it's indicating that you are passing ownership of the string to the caller, while `forget()` just indicates that you want to leak the thing.
[ Parent
| on HN ]
There are no comments on this comment yet.