fn os_str_to_u8_ref(os_str: &OsStr) -> std::io::Result<&[u8]> {
    match os_str.to_str() {
        Some(str) => Ok(str.as_bytes()),
        None => Err(Error::new(
            ErrorKind::Other,
            "Conversion from PathBuf to String failed.",
        )),
    }
}
/// Converts an OsStr reference to a byte array.
///
/// # Errors
///
/// Returns a custom std::io error if the conversion failed.
Converts an OsStr reference to a byte array.
Converts an OsStr reference to a byte array .
fn os_str_to_u8_ref(os_str: &OsStr) -> std::io::Result<&[u8]> {
    match os_str.to_str() {
        Some(str) => Ok(str.as_bytes()),
        None => Err(Error::new(
            ErrorKind::Other,
            "Conversion from PathBuf to String failed.",
        )),
    }
}
fn os_str_to_u8_ref ( os_str : & OsStr ) -> std :: io :: Result < & [ u8 ] > { match os_str . to_str ( ) { Some ( str ) => Ok ( str . as_bytes ( ) ) , None => Err ( Error :: new ( ErrorKind :: Other , " " , ) ) , } }
Converts an OsStr reference to a byte array.
Converts an OsStr reference to a byte array .
os_str
&OsStr
os_str
&OsStr
errors
Returns a custom std::io error if the conversion failed.
Returns a custom std :: io error if the conversion failed .