fn os_str_to_provider_id(os_str: &OsStr) -> std::io::Result<ProviderID> {
    match os_str.to_str() {
        Some(str) => match str.parse::<u8>() {
            Ok(provider_id_u8) => match ProviderID::try_from(provider_id_u8) {
                Ok(provider_id) => Ok(provider_id),
                Err(response_status) => {
                    Err(Error::new(ErrorKind::Other, response_status.to_string()))
                }
            },
            Err(_) => Err(Error::new(
                ErrorKind::Other,
                "Failed to convert Provider directory name to an u8 number.",
            )),
        },
        None => Err(Error::new(
            ErrorKind::Other,
            "Conversion from PathBuf to String failed.",
        )),
    }
}
/// Converts an OsStr reference to a ProviderID value.
///
/// # Errors
///
/// Returns a custom std::io error if the conversion failed.
Converts an OsStr reference to a ProviderID value.
Converts an OsStr reference to a ProviderID value .
fn os_str_to_provider_id(os_str: &OsStr) -> std::io::Result<ProviderID> {
    match os_str.to_str() {
        Some(str) => match str.parse::<u8>() {
            Ok(provider_id_u8) => match ProviderID::try_from(provider_id_u8) {
                Ok(provider_id) => Ok(provider_id),
                Err(response_status) => {
                    Err(Error::new(ErrorKind::Other, response_status.to_string()))
                }
            },
            Err(_) => Err(Error::new(
                ErrorKind::Other,
                "Failed to convert Provider directory name to an u8 number.",
            )),
        },
        None => Err(Error::new(
            ErrorKind::Other,
            "Conversion from PathBuf to String failed.",
        )),
    }
}
fn os_str_to_provider_id ( os_str : & OsStr ) -> std :: io :: Result < ProviderID > { match os_str . to_str ( ) { Some ( str ) => match str . parse :: < u8 > ( ) { Ok ( provider_id_u8 ) => match ProviderID :: try_from ( provider_id_u8 ) { Ok ( provider_id ) => Ok ( provider_id ) , Err ( response_status ) => { Err ( Error :: new ( ErrorKind :: Other , response_status . to_string ( ) ) ) } } , Err ( _ ) => Err ( Error :: new ( ErrorKind :: Other , " " , ) ) , } , None => Err ( Error :: new ( ErrorKind :: Other , " " , ) ) , } }
Converts an OsStr reference to a ProviderID value.
Converts an OsStr reference to a ProviderID value .
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 .