about summary refs log tree commit diff
diff options
context:
space:
mode:
authornham <hamann.nick@gmail.com>2014-08-06 12:23:21 -0400
committernham <hamann.nick@gmail.com>2014-08-06 12:23:21 -0400
commitefdb77b8d44fe2d5041ae3a5a8e0c7ef53715438 (patch)
tree3c3fcd7ef7eadc4e3558562a38f79e73cb15fa27
parent6df514b06123c7361730ac8ece999b2265b2f4ef (diff)
downloadrust-efdb77b8d44fe2d5041ae3a5a8e0c7ef53715438.tar.gz
rust-efdb77b8d44fe2d5041ae3a5a8e0c7ef53715438.zip
Remove cast to char in libserialize::hex
-rw-r--r--src/libserialize/hex.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs
index 2c1bfa5550b..f33ecb5f19b 100644
--- a/src/libserialize/hex.rs
+++ b/src/libserialize/hex.rs
@@ -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
                 }