diff options
| author | Kevin Ballard <[email protected]> | 2013-11-28 18:35:04 -0800 |
|---|---|---|
| committer | Kevin Ballard <[email protected]> | 2013-11-28 18:35:04 -0800 |
| commit | 7c05f58ac7aba88fca01d2091f7c05d59f2a6dd9 (patch) | |
| tree | 1fedfff693d6d32c93ca99e957ccef2fb6d2b9cf /hex.rs | |
| parent | Update for latest master (0.9-pre b42c438) (diff) | |
| download | rust-openssl-7c05f58ac7aba88fca01d2091f7c05d59f2a6dd9.tar.xz rust-openssl-7c05f58ac7aba88fca01d2091f7c05d59f2a6dd9.zip | |
Update for latest master (0.9-pre 90d06ec)
Diffstat (limited to 'hex.rs')
| -rw-r--r-- | hex.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -23,7 +23,7 @@ pub trait ToHex { impl<'self> ToHex for &'self [u8] { fn to_hex(&self) -> ~str { - let chars = "0123456789ABCDEF".iter().collect::<~[char]>(); + let chars = "0123456789ABCDEF".chars().collect::<~[char]>(); let mut s = ~""; @@ -50,7 +50,7 @@ impl<'self> FromHex for &'self str { fn from_hex(&self) -> ~[u8] { let mut vec = vec::with_capacity(self.len() / 2); - for (i,c) in self.iter().enumerate() { + for (i,c) in self.chars().enumerate() { let nibble = if c >= '0' && c <= '9' { (c as u8) - 0x30 } else if c >= 'a' && c <= 'f' { (c as u8) - (0x61 - 10) } |