nautilus_core::ffi::string

Function optional_cstr_to_ustr

Source
pub unsafe fn optional_cstr_to_ustr(ptr: *const c_char) -> Option<Ustr>
Expand description

Convert a C string pointer into an owned Option<Ustr>.

§Safety

  • Assumes ptr is a valid C string pointer or NULL.

§Panics

This function panics:

  • If ptr is null.