[go: up one dir, main page]

os_str_from_bytes

Function os_str_from_bytes 

Source
pub fn os_str_from_bytes(bytes: &[u8]) -> UResult<Cow<'_, OsStr>>
Expand description

Converts a &[u8] to an &OsStr, or parses it as UTF-8 into an OsString on non-unix platforms.

This always succeeds on unix platforms, and fails on other platforms if the bytes can’t be parsed as UTF-8.