astd::ffi::cstr

Function from_char_slice_unchecked

source
pub const unsafe fn from_char_slice_unchecked(slice: &[c_char]) -> &CStr
Expand description

Constructs a CStr reference from a c_char slice which contains a nul-terminator.

§Parameters

  • slice - a slice of c_char that ends with a nul-terminator.

§Safety

This function requires that slice be nul-terminated.