aboutsummaryrefslogtreecommitdiff
path: root/hex.rs
diff options
context:
space:
mode:
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) }