fn format_bytes(s: &str) -> String {
    let as_num = s.parse::<u128>();
    match as_num {
        Ok(n) => byte_unit::Byte::from_bytes(n)
            .get_appropriate_unit(false)
            .to_string(),
        Err(_) => s.to_string(),
    }
}
/// parse a string as a number of bytes, then format bytes as a human readable string.
parse a string as a number of bytes, then format bytes as a human readable string.
parse a string as a number of bytes then format bytes as a human readable string .
fn format_bytes(s: &str) -> String {
    let as_num = s.parse::<u128>();
    match as_num {
        Ok(n) => byte_unit::Byte::from_bytes(n)
            .get_appropriate_unit(false)
            .to_string(),
        Err(_) => s.to_string(),
    }
}
fn format_bytes ( s : & str ) -> String { let as_num = s . parse :: < u128 > ( ) ; match as_num { Ok ( n ) => byte_unit :: Byte :: from_bytes ( n ) . get_appropriate_unit ( false ) . to_string ( ) , Err ( _ ) => s . to_string ( ) , } }
parse a string as a number of bytes, then format bytes as a human readable string.
parse a string as a number of bytes then format bytes as a human readable string .
s
&str
s
&str