pub fn bytes_from_hex(hex: &str) -> Result<Vec<u8>, PacketError> {
    Ok(hex
        .chars()
        .chunks(2)
        .into_iter()
        .map(|mut chunk| u8::from_str_radix(&chunk.join(""), 16))
        .collect::<Result<Vec<_>, _>>()?)
}
/// Converts a hexadecimal string into a byte array.
///
/// # Errors
///
/// Will return `Err` if string is not valid hexadecimal.
Converts a hexadecimal string into a byte array.
Converts a hexadecimal string into a byte array .
pub fn bytes_from_hex(hex: &str) -> Result<Vec<u8>, PacketError> {
    Ok(hex
        .chars()
        .chunks(2)
        .into_iter()
        .map(|mut chunk| u8::from_str_radix(&chunk.join(""), 16))
        .collect::<Result<Vec<_>, _>>()?)
}
pub fn bytes_from_hex ( hex : & str ) -> Result < Vec < u8 > , PacketError > { Ok ( hex . chars ( ) . chunks ( 2 ) . into_iter ( ) . map ( | mut chunk | u8 :: from_str_radix ( & chunk . join ( " " ) , 16 ) ) . collect :: < Result < Vec < _ > , _ > > ( ) ? ) }
Converts a hexadecimal string into a byte array.
Converts a hexadecimal string into a byte array .
hex
&str
hex
&str
errors
Will return `Err` if string is not valid hexadecimal.
Will return ` Err ` if string is not valid hexadecimal .