MCPcopy Create free account
hub / github.com/apache/arrow-rs / parse_hex

Function parse_hex

arrow-json/src/reader/tape.rs:736–741  ·  view source on GitHub ↗

Parse a hex character to `u8`

(b: u8)

Source from the content-addressed store, hash-verified

734
735/// Parse a hex character to `u8`
736fn parse_hex(b: u8) -> Result<u8, ArrowError> {
737 let digit = char::from(b)
738 .to_digit(16)
739 .ok_or_else(|| err(b, "unicode escape"))?;
740 Ok(digit as u8)
741}
742
743#[cfg(test)]
744mod tests {

Callers 1

decodeMethod · 0.85

Calls 1

errFunction · 0.85

Tested by

no test coverage detected