MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / decode_fixed_hex

Function decode_fixed_hex

atomic-repository/src/git_binding/codec.rs:154–162  ·  view source on GitHub ↗
(hex: &str)

Source from the content-addressed store, hash-verified

152}
153
154fn 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
164impl fmt::Debug for GitOid {
165 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {

Callers 1

from_hexMethod · 0.85

Calls 2

collectMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected