Remove cast to char in libserialize::hex
This commit is contained in:
parent
6df514b061
commit
efdb77b8d4
@ -112,11 +112,11 @@ impl<'a> FromHex for &'a str {
|
||||
for (idx, byte) in self.bytes().enumerate() {
|
||||
buf <<= 4;
|
||||
|
||||
match byte as char {
|
||||
'A'..'F' => buf |= byte - b'A' + 10,
|
||||
'a'..'f' => buf |= byte - b'a' + 10,
|
||||
'0'..'9' => buf |= byte - b'0',
|
||||
' '|'\r'|'\n'|'\t' => {
|
||||
match byte {
|
||||
b'A'..b'F' => buf |= byte - b'A' + 10,
|
||||
b'a'..b'f' => buf |= byte - b'a' + 10,
|
||||
b'0'..b'9' => buf |= byte - b'0',
|
||||
b' '|b'\r'|b'\n'|b'\t' => {
|
||||
buf >>= 4;
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user