From 7c05f58ac7aba88fca01d2091f7c05d59f2a6dd9 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Thu, 28 Nov 2013 18:35:04 -0800 Subject: Update for latest master (0.9-pre 90d06ec) --- hex.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hex.rs') 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) } -- cgit v1.2.3 From bcdc23c359835fd8a3a872e8b66f47bb71046d91 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 14 Dec 2013 18:51:43 -0800 Subject: Update for latest rustc (0.9-pre ca54ad8) --- hex.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hex.rs') diff --git a/hex.rs b/hex.rs index 8a91c071..f55dc1a9 100644 --- a/hex.rs +++ b/hex.rs @@ -20,7 +20,7 @@ pub trait ToHex { fn to_hex(&self) -> ~str; } -impl<'self> ToHex for &'self [u8] { +impl<'a> ToHex for &'a [u8] { fn to_hex(&self) -> ~str { let chars = "0123456789ABCDEF".chars().collect::<~[char]>(); @@ -46,7 +46,7 @@ pub trait FromHex { fn from_hex(&self) -> ~[u8]; } -impl<'self> FromHex for &'self str { +impl<'a> FromHex for &'a str { fn from_hex(&self) -> ~[u8] { let mut vec = vec::with_capacity(self.len() / 2); -- cgit v1.2.3