remove unnecesarry borrow operator (`&`)

`assert_eq!` already borrows the arguments, so this is redundant.
This commit is contained in:
Antoni Spaanderman 2024-08-26 13:41:16 +02:00
parent fa3a3afd02
commit 28ccf70fa6
No known key found for this signature in database
GPG Key ID: AE0B68E552E5DF8C
8 changed files with 16 additions and 16 deletions

View File

@ -88,8 +88,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = hash160::Hash::engine();

View File

@ -477,8 +477,8 @@ 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.to_string(), &test.output_str);
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);

View File

@ -183,8 +183,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha1::Hash::engine();

View File

@ -916,8 +916,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha256::Hash::engine();

View File

@ -76,8 +76,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha256d::Hash::engine();

View File

@ -123,8 +123,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha384::Hash::engine();

View File

@ -370,8 +370,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha512::Hash::engine();

View File

@ -123,8 +123,8 @@ 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.to_string(), &test.output_str);
assert_eq!(hash[..], test.output);
assert_eq!(hash.to_string(), test.output_str);
// Hash through engine, checking that we can input byte by byte
let mut engine = sha512_256::Hash::engine();