From 28ccf70fa66bec9608472b2c751b3347415dbcfe Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Mon, 26 Aug 2024 13:41:16 +0200 Subject: [PATCH] remove unnecesarry borrow operator (`&`) `assert_eq!` already borrows the arguments, so this is redundant. --- hashes/src/hash160.rs | 4 ++-- hashes/src/ripemd160.rs | 4 ++-- hashes/src/sha1.rs | 4 ++-- hashes/src/sha256.rs | 4 ++-- hashes/src/sha256d.rs | 4 ++-- hashes/src/sha384.rs | 4 ++-- hashes/src/sha512.rs | 4 ++-- hashes/src/sha512_256.rs | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hashes/src/hash160.rs b/hashes/src/hash160.rs index 3e96c8c1e..9e85271ba 100644 --- a/hashes/src/hash160.rs +++ b/hashes/src/hash160.rs @@ -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::().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(); diff --git a/hashes/src/ripemd160.rs b/hashes/src/ripemd160.rs index 70e711d19..dffdfaf40 100644 --- a/hashes/src/ripemd160.rs +++ b/hashes/src/ripemd160.rs @@ -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::().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); diff --git a/hashes/src/sha1.rs b/hashes/src/sha1.rs index 66db27774..5c586c07e 100644 --- a/hashes/src/sha1.rs +++ b/hashes/src/sha1.rs @@ -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::().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(); diff --git a/hashes/src/sha256.rs b/hashes/src/sha256.rs index 8e78e5136..b3d0f0e59 100644 --- a/hashes/src/sha256.rs +++ b/hashes/src/sha256.rs @@ -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::().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(); diff --git a/hashes/src/sha256d.rs b/hashes/src/sha256d.rs index afd2d10f1..6e26ea643 100644 --- a/hashes/src/sha256d.rs +++ b/hashes/src/sha256d.rs @@ -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::().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(); diff --git a/hashes/src/sha384.rs b/hashes/src/sha384.rs index e28448440..6ab941449 100644 --- a/hashes/src/sha384.rs +++ b/hashes/src/sha384.rs @@ -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::().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(); diff --git a/hashes/src/sha512.rs b/hashes/src/sha512.rs index b85e2fc51..1642129d4 100644 --- a/hashes/src/sha512.rs +++ b/hashes/src/sha512.rs @@ -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::().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(); diff --git a/hashes/src/sha512_256.rs b/hashes/src/sha512_256.rs index c1c2767c1..1f373b11f 100644 --- a/hashes/src/sha512_256.rs +++ b/hashes/src/sha512_256.rs @@ -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::().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();