Skip to content

Commit efdb77b

Browse files
committed
Remove cast to char in libserialize::hex
1 parent 6df514b commit efdb77b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libserialize/hex.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ impl<'a> FromHex for &'a str {
112112
for (idx, byte) in self.bytes().enumerate() {
113113
buf <<= 4;
114114

115-
match byte as char {
116-
'A'..'F' => buf |= byte - b'A' + 10,
117-
'a'..'f' => buf |= byte - b'a' + 10,
118-
'0'..'9' => buf |= byte - b'0',
119-
' '|'\r'|'\n'|'\t' => {
115+
match byte {
116+
b'A'..b'F' => buf |= byte - b'A' + 10,
117+
b'a'..b'f' => buf |= byte - b'a' + 10,
118+
b'0'..b'9' => buf |= byte - b'0',
119+
b' '|b'\r'|b'\n'|b'\t' => {
120120
buf >>= 4;
121121
continue
122122
}

0 commit comments

Comments
 (0)