remove unnecesarry borrow operator (`&`)
`assert_eq!` already borrows the arguments, so this is redundant.
This commit is contained in:
parent
fa3a3afd02
commit
28ccf70fa6
|
@ -88,8 +88,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = hash160::Hash::hash(&test.input[..]);
|
let hash = hash160::Hash::hash(&test.input[..]);
|
||||||
assert_eq!(hash, test.output_str.parse::<hash160::Hash>().expect("parse hex"));
|
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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = hash160::Hash::engine();
|
let mut engine = hash160::Hash::engine();
|
||||||
|
|
|
@ -477,8 +477,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = ripemd160::Hash::hash(test.input.as_bytes());
|
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_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!(hash.to_string(), test.output_str);
|
||||||
assert_eq!(ripemd160::Hash::from_bytes_ref(&test.output), &hash);
|
assert_eq!(ripemd160::Hash::from_bytes_ref(&test.output), &hash);
|
||||||
assert_eq!(ripemd160::Hash::from_bytes_mut(&mut test.output), &hash);
|
assert_eq!(ripemd160::Hash::from_bytes_mut(&mut test.output), &hash);
|
||||||
|
|
||||||
|
|
|
@ -183,8 +183,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha1::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha1::Hash::engine();
|
let mut engine = sha1::Hash::engine();
|
||||||
|
|
|
@ -916,8 +916,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha256::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha256::Hash::engine();
|
let mut engine = sha256::Hash::engine();
|
||||||
|
|
|
@ -76,8 +76,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha256d::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha256d::Hash::engine();
|
let mut engine = sha256d::Hash::engine();
|
||||||
|
|
|
@ -123,8 +123,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha384::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha384::Hash::engine();
|
let mut engine = sha384::Hash::engine();
|
||||||
|
|
|
@ -370,8 +370,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha512::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha512::Hash::engine();
|
let mut engine = sha512::Hash::engine();
|
||||||
|
|
|
@ -123,8 +123,8 @@ mod tests {
|
||||||
// Hash through high-level API, check hex encoding/decoding
|
// Hash through high-level API, check hex encoding/decoding
|
||||||
let hash = sha512_256::Hash::hash(test.input.as_bytes());
|
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_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);
|
assert_eq!(hash.to_string(), test.output_str);
|
||||||
|
|
||||||
// Hash through engine, checking that we can input byte by byte
|
// Hash through engine, checking that we can input byte by byte
|
||||||
let mut engine = sha512_256::Hash::engine();
|
let mut engine = sha512_256::Hash::engine();
|
||||||
|
|
Loading…
Reference in New Issue