Remove the unnecessary explicit reference

Clippy emits various warnings of form:

 warning: this expression creates a reference which is immediately
 dereferenced by the compiler

As suggested, remove the unnecessary explicit reference.
This commit is contained in:
Tobin C. Harding 2022-11-30 14:41:14 +11:00
parent 9266b1bbe0
commit 5e67f7a7cb
5 changed files with 5 additions and 5 deletions

View File

@ -469,7 +469,7 @@ mod tests {
for test in tests {
// 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, ripemd160::Hash::from_hex(test.output_str).expect("parse hex"));
assert_eq!(&hash[..], &test.output[..]);
assert_eq!(&hash.to_hex(), &test.output_str);

View File

@ -195,7 +195,7 @@ mod tests {
for test in tests {
// 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, sha1::Hash::from_hex(test.output_str).expect("parse hex"));
assert_eq!(&hash[..], &test.output[..]);
assert_eq!(&hash.to_hex(), &test.output_str);

View File

@ -371,7 +371,7 @@ mod tests {
for test in tests {
// 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, sha256::Hash::from_hex(test.output_str).expect("parse hex"));
assert_eq!(&hash[..], &test.output[..]);
assert_eq!(&hash.to_hex(), &test.output_str);

View File

@ -74,7 +74,7 @@ mod tests {
for test in tests {
// 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, sha256d::Hash::from_hex(test.output_str).expect("parse hex"));
assert_eq!(&hash[..], &test.output[..]);
assert_eq!(&hash.to_hex(), &test.output_str);

View File

@ -368,7 +368,7 @@ mod tests {
for test in tests {
// 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, sha512::Hash::from_hex(test.output_str).expect("parse hex"));
assert_eq!(&hash[..], &test.output[..]);
assert_eq!(&hash.to_hex(), &test.output_str);