Method lrs::string::CStr::from_bytes_unchecked

Casts a byte slice to a CStr without checking it for validity.

Syntax

impl CStr {
    unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &CStr
}

Arguments

NameDescription
bytes

The slice to be interpreted as a CStr.

Remarks

If the slice doesn't have exactly one null byte as its last entry, the behavior is undefined.