From 61d7c3ff3a009204cba3ab6cccc6f70cc2cd1eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milos=CC=8C=20Hadz=CC=8Cic=CC=81?= Date: Tue, 6 Aug 2013 03:57:03 +0200 Subject: Update syntax for latest Rust master (rust 0.8-pre bbda3fa). --- hex.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hex.rs') diff --git a/hex.rs b/hex.rs index 710f572c..b479ea18 100644 --- a/hex.rs +++ b/hex.rs @@ -14,7 +14,7 @@ * limitations under the License. */ -use std::{uint,vec}; +use std::vec; pub trait ToHex { fn to_hex(&self) -> ~str; @@ -27,7 +27,7 @@ impl<'self> ToHex for &'self [u8] { let mut s = ~""; - for uint::range(0, self.len()) |i| { + for i in range(0u, self.len()) { let x = self[i]; @@ -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 self.iter().enumerate().advance() |(i,c)| { + for (i,c) in self.iter().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