From 6970ca20f12219f3aa14bac6d99967e2773b8a31 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 2 Jul 2013 14:15:41 -0700 Subject: [PATCH] Update for 0.7 --- hash.rs | 7 +++---- hex.rs | 2 +- pkey.rs | 8 ++++---- symm.rs | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/hash.rs b/hash.rs index 8d5db180..688ef7fd 100644 --- a/hash.rs +++ b/hash.rs @@ -109,7 +109,6 @@ mod tests { use super::*; use hex::FromHex; use hex::ToHex; - use std::vec; struct HashTest { input: ~[u8], @@ -152,7 +151,7 @@ mod tests { HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"), HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")]; - for vec::each(tests) |test| { + for tests.iter().advance |test| { hash_test(MD5, test); } } @@ -164,7 +163,7 @@ mod tests { HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"), ]; - for vec::each(tests) |test| { + for tests.iter().advance |test| { hash_test(SHA1, test); } } @@ -175,7 +174,7 @@ mod tests { HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD") ]; - for vec::each(tests) |test| { + for tests.iter().advance |test| { hash_test(SHA256, test); } } diff --git a/hex.rs b/hex.rs index 6675a9f2..710f572c 100644 --- a/hex.rs +++ b/hex.rs @@ -58,7 +58,7 @@ impl<'self> FromHex for &'self str { else { fail!(~"bad hex character"); }; if i % 2 == 0 { - vec::push(&mut vec, nibble << 4); + vec.push(nibble << 4); } else { vec[i/2] |= nibble; diff --git a/pkey.rs b/pkey.rs index 83dafd52..d9cdbdf1 100644 --- a/pkey.rs +++ b/pkey.rs @@ -110,7 +110,7 @@ impl PKey { f(self.evp, &ps) }; - vec::slice(s, 0u, r as uint).to_owned() + s.slice(0u, r as uint).to_owned() } priv unsafe fn _fromstr( @@ -256,7 +256,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { - vec::slice(r, 0u, rv as uint).to_owned() + r.slice(0u, rv as uint).to_owned() } } } @@ -285,7 +285,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { - vec::slice(r, 0u, rv as uint).to_owned() + r.slice(0u, rv as uint).to_owned() } } } @@ -334,7 +334,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { - vec::slice(r, 0u, len as uint).to_owned() + r.slice(0u, len as uint).to_owned() } } } diff --git a/symm.rs b/symm.rs index bd73dc9d..dc4288a7 100644 --- a/symm.rs +++ b/symm.rs @@ -148,7 +148,7 @@ impl Crypter { reslen }; - vec::slice(res, 0u, reslen as uint).to_owned() + res.slice(0u, reslen as uint).to_owned() } } } @@ -166,7 +166,7 @@ impl Crypter { reslen }; - vec::slice(res, 0u, reslen as uint).to_owned() + res.slice(0u, reslen as uint).to_owned() } } }