Remove cast to char in libserialize::hex

This commit is contained in:
nham 2014-08-06 12:23:21 -04:00
parent 6df514b061
commit efdb77b8d4

View File

@ -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
}