Update for 0.7

This commit is contained in:
Kevin Ballard 2013-07-02 14:15:41 -07:00
parent 9ff6dd59a1
commit 6970ca20f1
4 changed files with 10 additions and 11 deletions

View File

@ -109,7 +109,6 @@ mod tests {
use super::*; use super::*;
use hex::FromHex; use hex::FromHex;
use hex::ToHex; use hex::ToHex;
use std::vec;
struct HashTest { struct HashTest {
input: ~[u8], input: ~[u8],
@ -152,7 +151,7 @@ mod tests {
HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"), HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"),
HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")]; HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")];
for vec::each(tests) |test| { for tests.iter().advance |test| {
hash_test(MD5, test); hash_test(MD5, test);
} }
} }
@ -164,7 +163,7 @@ mod tests {
HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"), HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"),
]; ];
for vec::each(tests) |test| { for tests.iter().advance |test| {
hash_test(SHA1, test); hash_test(SHA1, test);
} }
} }
@ -175,7 +174,7 @@ mod tests {
HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD") HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD")
]; ];
for vec::each(tests) |test| { for tests.iter().advance |test| {
hash_test(SHA256, test); hash_test(SHA256, test);
} }
} }

2
hex.rs
View File

@ -58,7 +58,7 @@ impl<'self> FromHex for &'self str {
else { fail!(~"bad hex character"); }; else { fail!(~"bad hex character"); };
if i % 2 == 0 { if i % 2 == 0 {
vec::push(&mut vec, nibble << 4); vec.push(nibble << 4);
} }
else { else {
vec[i/2] |= nibble; vec[i/2] |= nibble;

View File

@ -110,7 +110,7 @@ impl PKey {
f(self.evp, &ps) 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( priv unsafe fn _fromstr(
@ -256,7 +256,7 @@ impl PKey {
if rv < 0 as c_int { if rv < 0 as c_int {
~[] ~[]
} else { } 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 { if rv < 0 as c_int {
~[] ~[]
} else { } 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 { if rv < 0 as c_int {
~[] ~[]
} else { } else {
vec::slice(r, 0u, len as uint).to_owned() r.slice(0u, len as uint).to_owned()
} }
} }
} }

View File

@ -148,7 +148,7 @@ impl Crypter {
reslen 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 reslen
}; };
vec::slice(res, 0u, reslen as uint).to_owned() res.slice(0u, reslen as uint).to_owned()
} }
} }
} }