Skip to main content

os_str_as_bytes

Function os_str_as_bytes 

Source
pub fn os_str_as_bytes(os_string: &OsStr) -> Result<&[u8], NonUtf8OsStrError>
Expand description

Converts an OsStr to a UTF-8 &[u8].

This always succeeds on unix platforms, and fails on other platforms if the string can’t be coerced to UTF-8.