fn string_from_hex_bytes(data: &[u8]) -> GitResult<String> {
    let mut result = String::new();
    for byte in data {
        if (*byte < b'0' || *byte > b'9') && (*byte < b'a' && *byte > b'f') {
            return Err(GitError::from("Invalid hex character"));
        }
        result.push(*byte as char);
    }
    Ok(result)
}
// Convert a vec of hex bytes into a String
// Only the characters 0-9 and a-f are accepted
Convert a vec of hex bytes into a String
Only the characters 0-9 and a-f are accepted
Convert a vec of hex bytes into a String Only the characters 0 - 9 and a - f are accepted
fn string_from_hex_bytes(data: &[u8]) -> GitResult<String> {
    let mut result = String::new();
    for byte in data {
        if (*byte < b'0' || *byte > b'9') && (*byte < b'a' && *byte > b'f') {
            return Err(GitError::from("Invalid hex character"));
        }
        result.push(*byte as char);
    }
    Ok(result)
}
fn string_from_hex_bytes ( data : & [ u8 ] ) -> GitResult < String > { let mut result = String :: new ( ) ; for byte in data { if ( * byte < b'0' || * byte > b'9' ) && ( * byte < b'a' && * byte > b'f' ) { return Err ( GitError :: from ( " " ) ) ; } result . push ( * byte as char ) ; } Ok ( result ) }
Convert a vec of hex bytes into a String
Only the characters 0-9 and a-f are accepted
Convert a vec of hex bytes into a String Only the characters 0 - 9 and a - f are accepted
data
&[u8]
data
&[u8]