aboutsummaryrefslogtreecommitdiff
path: root/hex.rs
diff options
context:
space:
mode:
authorKevin Ballard <[email protected]>2013-11-28 18:35:04 -0800
committerKevin Ballard <[email protected]>2013-11-28 18:35:04 -0800
commit7c05f58ac7aba88fca01d2091f7c05d59f2a6dd9 (patch)
tree1fedfff693d6d32c93ca99e957ccef2fb6d2b9cf /hex.rs
parentUpdate for latest master (0.9-pre b42c438) (diff)
downloadrust-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.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/hex.rs b/hex.rs
index b479ea18..8a91c071 100644
--- a/hex.rs
+++ b/hex.rs
@@ -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) }