vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(test)]
pub(crate) fn hex_to_bytes(hex: &str) -> Result<Vec<u8>, String> {
    if hex.len() % 2 != 0 {
        return Err(format!(
            "Fix: fixture hex strings must contain an even number of digits, got {}",
            hex.len()
        ));
    }
    (0..hex.len())
        .step_by(2)
        .map(|idx| {
            u8::from_str_radix(&hex[idx..idx + 2], 16).map_err(|error| {
                format!("Fix: fixture hex byte at offset {idx} must be valid hexadecimal: {error}")
            })
        })
        .collect()
}