aboutsummaryrefslogtreecommitdiff
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
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).
-rw-r--r--hash.rs6
-rw-r--r--hex.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/hash.rs b/hash.rs
index c55515d1..88f75f67 100644
--- a/hash.rs
+++ b/hash.rs
@@ -151,7 +151,7 @@ mod tests {
HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"),
HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")];
- for tests.iter().advance |test| {
+ for test in tests.iter() {
hash_test(MD5, test);
}
}
@@ -163,7 +163,7 @@ mod tests {
HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"),
];
- for tests.iter().advance |test| {
+ for test in tests.iter() {
hash_test(SHA1, test);
}
}
@@ -174,7 +174,7 @@ mod tests {
HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD")
];
- for tests.iter().advance |test| {
+ for test in tests.iter() {
hash_test(SHA256, test);
}
}
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) }