pub(crate) fn cstr_cow_from_bytes(slice: &[u8]) -> Result<Cow<'_, CStr>, Error>
Expand description

Checks for the last byte and avoids allocating if it is zero.

Non-last null bytes still result in an error.