From e302e30e7c1eb786debbaa476d90bb739b437fee Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 28 Feb 2024 09:14:32 +1100 Subject: [PATCH] Import with super::* in unit test As is customary import using a wildcard. Includes `use Hash as _` to remove naming conflict between the trait and type. --- hashes/src/sha256.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hashes/src/sha256.rs b/hashes/src/sha256.rs index 77eca04b..19d166f8 100644 --- a/hashes/src/sha256.rs +++ b/hashes/src/sha256.rs @@ -817,7 +817,8 @@ impl HashEngine { #[cfg(test)] mod tests { - use crate::{sha256, Hash, HashEngine}; + use crate::{sha256, Hash as _, HashEngine}; + use super::*; #[test] #[cfg(feature = "alloc")] @@ -964,14 +965,14 @@ mod tests { #[test] fn const_hash() { - assert_eq!(super::Hash::hash(&[]), super::Hash::const_hash(&[])); + assert_eq!(Hash::hash(&[]), Hash::const_hash(&[])); let mut bytes = Vec::new(); for i in 0..256 { bytes.push(i as u8); assert_eq!( - super::Hash::hash(&bytes), - super::Hash::const_hash(&bytes), + Hash::hash(&bytes), + Hash::const_hash(&bytes), "hashes don't match for length {}", i + 1 ); @@ -980,8 +981,6 @@ mod tests { #[test] fn const_midstate() { - use super::Midstate; - assert_eq!( Midstate::hash_tag(b"TapLeaf"), Midstate([