Skip to main content

c_char_to_str

Function c_char_to_str 

Source
pub(crate) unsafe fn c_char_to_str(text: *const c_char) -> &'static str
Expand description

Converts a zstd-owned C string to a str.

ยงSafety

text must point to a nul-terminated C string that lives for the rest of the program - which is what the zstd functions this is used with return, as they hand back pointers to static string literals.