From d72f7302116ca8e44487d389cd67860d5f2e02f4 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 6 Sep 2024 09:20:10 +1000 Subject: [PATCH] hashes: Use $crate in internal macros These are only called from within the crate but it is still more correct to use `$crate` and saves this from biting us later if we copy the code someplace else. Internal change only. --- hashes/src/internal_macros.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs index 9bf1cf9ac..f07ff176a 100644 --- a/hashes/src/internal_macros.rs +++ b/hashes/src/internal_macros.rs @@ -99,13 +99,13 @@ macro_rules! hash_trait_impls { } } - impl<$($gen: $gent),*> crate::GeneralHash for Hash<$($gen),*> { + impl<$($gen: $gent),*> $crate::GeneralHash for Hash<$($gen),*> { type Engine = HashEngine; fn from_engine(e: HashEngine) -> Hash<$($gen),*> { Self::from_engine(e) } } - impl<$($gen: $gent),*> crate::Hash for Hash<$($gen),*> { + impl<$($gen: $gent),*> $crate::Hash for Hash<$($gen),*> { type Bytes = [u8; $bits / 8]; const DISPLAY_BACKWARD: bool = $reverse; @@ -148,7 +148,7 @@ macro_rules! hash_type { /// Hashes some bytes. #[allow(clippy::self_named_constructors)] // Hash is a noun and a verb. - pub fn hash(data: &[u8]) -> Self { ::hash(data) } + pub fn hash(data: &[u8]) -> Self { ::hash(data) } /// Hashes all the byte slices retrieved from the iterator together. pub fn hash_byte_chunks(byte_slices: I) -> Self @@ -156,13 +156,13 @@ macro_rules! hash_type { B: AsRef<[u8]>, I: IntoIterator, { - ::hash_byte_chunks(byte_slices) + ::hash_byte_chunks(byte_slices) } /// Hashes the entire contents of the `reader`. #[cfg(feature = "bitcoin-io")] pub fn hash_reader(reader: &mut R) -> Result { - ::hash_reader(reader) + ::hash_reader(reader) } } }; @@ -245,7 +245,7 @@ macro_rules! hash_type_no_default { } } - crate::internal_macros::hash_trait_impls!($bits, $reverse); + $crate::internal_macros::hash_trait_impls!($bits, $reverse); }; } pub(crate) use hash_type_no_default;