diff options
| author | Kevin Ballard <[email protected]> | 2013-06-08 17:22:54 -0700 |
|---|---|---|
| committer | Kevin Ballard <[email protected]> | 2013-06-08 17:22:54 -0700 |
| commit | 1a88757ca2690807304ebdd0784b853abc1b64b6 (patch) | |
| tree | 8c3416d7d4ec9cc7f1a95a6963be15c41ec610a4 /hex.rs | |
| parent | Update for latest incoming (3a3bf8b) (diff) | |
| download | rust-openssl-1a88757ca2690807304ebdd0784b853abc1b64b6.tar.xz rust-openssl-1a88757ca2690807304ebdd0784b853abc1b64b6.zip | |
Update to latest incoming (878a9b9)
Diffstat (limited to 'hex.rs')
| -rw-r--r-- | hex.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -15,6 +15,7 @@ */ use std::{str,uint,vec}; +use std::iterator::*; pub trait ToHex { fn to_hex(&self) -> ~str; @@ -50,8 +51,7 @@ impl<'self> FromHex for &'self str { fn from_hex(&self) -> ~[u8] { let mut vec = vec::with_capacity(self.len() / 2); - for str::each_chari(*self) |i,c| { - + for self.iter().enumerate().advance() |(i,c)| { let nibble = if c >= '0' && c <= '9' { (c as u8) - 0x30 } else if c >= 'a' && c <= 'f' { (c as u8) - (0x61 - 10) } |