Closed d-unsed closed 8 years ago
So, I have some concerns this still won't work. I am about to step out, but I will try it on my machine to check.
str_to_cstring(name).as_ptr(),
So, because this ends up being a temporary, I'm not sure if it gets destroyed before the call is over. I can see that it might not, but I can see that it might, as well.
Seems to work fine. :+1:
Should work fine, just tested with dummy CString
implementation + Drop
trait
In this case pointer does not outlive the string unlike the first implementation 😄
Yeah, I just always get a bit suspicious with temporaries :)
util::str_to_cstring
function@steveklabnik, a small clean up for the hacking session #4 😄
Trying to DRY up the
CString
handling. Similar approach worked fine forVec -> ptr
conversions (1b9932904646741229a683d86a0e7761ab02a41f)