aboutsummaryrefslogtreecommitdiff
path: root/hex.rs
diff options
context:
space:
mode:
authorErick Tryzelaar <[email protected]>2013-12-18 07:30:16 -0800
committerErick Tryzelaar <[email protected]>2013-12-18 07:30:16 -0800
commit4e0257ab5991eaa6863d261f97dcf6ff8e6b7545 (patch)
treed58c184dae0040a0afbf9f4b8e8eb83e72cef314 /hex.rs
parentIntegrate with Travis (diff)
parentUpdate for latest rustc (0.9-pre ca54ad8) (diff)
downloadrust-openssl-4e0257ab5991eaa6863d261f97dcf6ff8e6b7545.tar.xz
rust-openssl-4e0257ab5991eaa6863d261f97dcf6ff8e6b7545.zip
Merge branch 'master' of https://github.com/kballard/rustcrypto
Diffstat (limited to 'hex.rs')
-rw-r--r--hex.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/hex.rs b/hex.rs
index b479ea18..f55dc1a9 100644
--- a/hex.rs
+++ b/hex.rs
@@ -20,10 +20,10 @@ 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".iter().collect::<~[char]>();
+ let chars = "0123456789ABCDEF".chars().collect::<~[char]>();
let mut s = ~"";
@@ -46,11 +46,11 @@ 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);
- 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) }