(hex: &str)
| 152 | } |
| 153 | |
| 154 | fn decode_fixed_hex(hex: &str) -> Result<Vec<u8>, BindingEncodeError> { |
| 155 | (0..hex.len()) |
| 156 | .step_by(2) |
| 157 | .map(|index| { |
| 158 | u8::from_str_radix(&hex[index..index + 2], 16) |
| 159 | .map_err(|error| BindingEncodeError::Oid(error.to_string())) |
| 160 | }) |
| 161 | .collect() |
| 162 | } |
| 163 | |
| 164 | impl fmt::Debug for GitOid { |
| 165 | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { |