unsafe fn cstring_to_str<'a>(cstring: &'a *const c_char) -> &str {
    if cstring.is_null() {
        // Of course in a real project you'd return Result instead
        panic!("cstring is null")
    }

    let raw = ::std::ffi::CStr::from_ptr(*cstring);
    raw.to_str().expect("Couldn't convert c string to slice")
}
// Convert C string to Rust string slice
Convert C string to Rust string slice
Convert C string to Rust string slice
unsafe fn cstring_to_str<'a>(cstring: &'a *const c_char) -> &str {
    if cstring.is_null() {
        // Of course in a real project you'd return Result instead
        panic!("cstring is null")
    }
    let raw = ::std::ffi::CStr::from_ptr(*cstring);
    raw.to_str().expect("Couldn't convert c string to slice")
}
unsafe fn cstring_to_str < ' a > ( cstring : & ' a * const c_char ) -> & str { if cstring . is_null ( ) { // Of course in a real project you'd return Result instead panic ! ( " " ) } let raw = :: std :: ffi :: CStr :: from_ptr ( * cstring ) ; raw . to_str ( ) . expect ( " " ) }
Convert C string to Rust string slice
Convert C string to Rust string slice
cstring
&'a *const c_char