Function rsvg::util::opt_utf8_cstr

source ·
pub unsafe fn opt_utf8_cstr<'a>(s: *const c_char) -> Option<&'a str>
Expand description

Converts a char * which is known to be valid UTF-8 into an Option<&str>

NULL pointers get converted to None.

Safety: s must be null, or a nul-terminated, valid UTF-8 string of bytes.