aboutsummaryrefslogtreecommitdiff
path: root/hex.rs
diff options
context:
space:
mode:
authorKevin Ballard <[email protected]>2013-06-08 17:22:54 -0700
committerKevin Ballard <[email protected]>2013-06-08 17:22:54 -0700
commit1a88757ca2690807304ebdd0784b853abc1b64b6 (patch)
tree8c3416d7d4ec9cc7f1a95a6963be15c41ec610a4 /hex.rs
parentUpdate for latest incoming (3a3bf8b) (diff)
downloadrust-openssl-1a88757ca2690807304ebdd0784b853abc1b64b6.tar.xz
rust-openssl-1a88757ca2690807304ebdd0784b853abc1b64b6.zip
Update to latest incoming (878a9b9)
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 e838080a..415b86cd 100644
--- a/hex.rs
+++ b/hex.rs
@@ -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) }