hashes: Rename serde_impl to impl_serde_traits
What changed, and why it matters
This commit is a pure rename of an internal Rust macro from `serde_impl!` to `impl_serde_traits!` to match the project's naming convention. No code behavior changes; it is a cosmetic refactoring.
No security action needed; this is a non-functional rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff renames the exported macro serde_impl to impl_serde_traits in hashes/src/macros.rs and updates its two call sites in hashes/src/internal_macros.rs and hashes/src/macros.rs. Both the serde-enabled and serde-disabled macro bodies are otherwise identical, so functionality is unchanged.
Changed components
hashes/src/internal_macros.rshashes/src/macros.rsInspect captured patch +4 / −4
diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs
index 200cd9c6..ea7860ed 100644
--- a/hashes/src/internal_macros.rs
+++ b/hashes/src/internal_macros.rs
@@ -25,7 +25,7 @@ macro_rules! hash_trait_impls {
$crate::impl_debug_only!(Hash, { $bits / 8 }, $reverse $(, $gen: $gent)*);
#[cfg(feature = "serde")]
- $crate::serde_impl!(Hash, { $bits / 8} $(, $gen: $gent)*);
+ $crate::impl_serde_traits!(Hash, { $bits / 8} $(, $gen: $gent)*);
impl<$($gen: $gent),*> $crate::Hash for Hash<$($gen),*> {
type Bytes = [u8; $bits / 8];
diff --git a/hashes/src/macros.rs b/hashes/src/macros.rs
index 30a39933..2b8e7b73 100644
--- a/hashes/src/macros.rs
+++ b/hashes/src/macros.rs
@@ -522,7 +522,7 @@ pub mod serde_details {
macro_rules! impl_serde_for_newtype {
($($newtype:ident),*) => {
$(
- $crate::serde_impl!($newtype, { <$newtype as $crate::Hash>::LEN });
+ $crate::impl_serde_traits!($newtype, { <$newtype as $crate::Hash>::LEN });
)*
}
}
@@ -532,7 +532,7 @@ macro_rules! impl_serde_for_newtype {
#[doc(hidden)]
#[macro_export]
#[cfg(feature = "serde")]
-macro_rules! serde_impl(
+macro_rules! impl_serde_traits(
($t:ident, $len:expr $(, $gen:ident: $gent:ident)*) => (
impl<$($gen: $gent),*> $crate::serde::Serialize for $t<$($gen),*> {
fn serialize<S: $crate::serde::Serializer>(&self, s: S) -> core::result::Result<S::Ok, S::Error> {
@@ -561,7 +561,7 @@ macro_rules! serde_impl(
#[doc(hidden)]
#[macro_export]
#[cfg(not(feature = "serde"))]
-macro_rules! serde_impl(
+macro_rules! impl_serde_traits(
($t:ident, $len:expr $(, $gen:ident: $gent:ident)*) => ()
);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.