aboutsummaryrefslogtreecommitdiff
path: root/hex.rs
diff options
context:
space:
mode:
authorMiloš Hadžić <[email protected]>2013-08-06 03:57:03 +0200
committerMiloš Hadžić <[email protected]>2013-08-06 03:57:03 +0200
commit61d7c3ff3a009204cba3ab6cccc6f70cc2cd1eaf (patch)
tree7351dffbd2d6bbf35112d2a740881a7bc4530b62 /hex.rs
parentUpdate to latest master (0.8-pre 4989799) (diff)
downloadrust-openssl-61d7c3ff3a009204cba3ab6cccc6f70cc2cd1eaf.tar.xz
rust-openssl-61d7c3ff3a009204cba3ab6cccc6f70cc2cd1eaf.zip
Update syntax for latest Rust master (rust 0.8-pre bbda3fa).
Diffstat (limited to 'hex.rs')
-rw-r--r--hex.rs6
1 files changed, 3 insertions, 3 deletions
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) }