remove unnecessary slicing
This was needed in older versions of Rust that are not supported anymore by this crate.
This commit is contained in:
parent
22e42ab86c
commit
fa3a3afd02
|
@ -88,7 +88,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = hash160::Hash::hash(&test.input[..]);
|
||||
assert_eq!(hash, test.output_str.parse::<hash160::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -477,7 +477,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = ripemd160::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<ripemd160::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
assert_eq!(ripemd160::Hash::from_bytes_ref(&test.output), &hash);
|
||||
assert_eq!(ripemd160::Hash::from_bytes_mut(&mut test.output), &hash);
|
||||
|
|
|
@ -183,7 +183,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha1::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha1::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -916,7 +916,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha256::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha256::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -76,7 +76,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha256d::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha256d::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -123,7 +123,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha384::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha384::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -370,7 +370,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha512::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha512::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -123,7 +123,7 @@ mod tests {
|
|||
// Hash through high-level API, check hex encoding/decoding
|
||||
let hash = sha512_256::Hash::hash(test.input.as_bytes());
|
||||
assert_eq!(hash, test.output_str.parse::<sha512_256::Hash>().expect("parse hex"));
|
||||
assert_eq!(&hash[..], &test.output[..]);
|
||||
assert_eq!(&hash[..], &test.output);
|
||||
assert_eq!(&hash.to_string(), &test.output_str);
|
||||
|
||||
// Hash through engine, checking that we can input byte by byte
|
||||
|
|
|
@ -318,7 +318,7 @@ mod tests {
|
|||
|
||||
for i in 0..64 {
|
||||
vin[i] = i as u8;
|
||||
let vec = Hash::from_slice(&vecs[i][..]).unwrap();
|
||||
let vec = Hash::from_slice(&vecs[i]).unwrap();
|
||||
let out = Hash::hash_with_keys(k0, k1, &vin[0..i]);
|
||||
assert_eq!(vec, out, "vec #{}", i);
|
||||
|
||||
|
|
Loading…
Reference in New Issue