a bit more usize::from

This commit is contained in:
Michal Nazarewicz 2023-04-30 15:40:54 +02:00
parent 4d0f7e2f39
commit 76c9947024

View File

@ -17,7 +17,9 @@
b'"' => ([b'\\', b'"', 0, 0], 2),
b'\x20'..=b'\x7e' => ([byte, 0, 0, 0], 1),
_ => {
([b'\\', b'x', HEX_DIGITS[(byte >> 4) as usize], HEX_DIGITS[(byte & 0xf) as usize]], 4)
let hi = HEX_DIGITS[usize::from(byte >> 4)];
let lo = HEX_DIGITS[usize::from(byte & 0xf)];
([b'\\', b'x', hi, lo], 4)
}
};
*output = data;