Clarify feature gate on impl_to_hex_from_lower_hex macro
What changed, and why it matters
This commit only changes a documentation comment for an internal Rust macro. It removes an outdated note claiming the macro checks for an 'alloc' feature and updates the description to match what the code actually does. No code behavior changes, and there is no security relevance.
No action needed. This is a non-functional documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies internals/src/macros.rs, updating the doc comment on the impl_to_hex_from_lower_hex macro. The previous comment incorrectly stated that the macro is a no-op unless the calling crate enables an ‘alloc’ feature. The new comment removes that claim and simply documents that the macro adds a to_hex method returning a String. The macro body is unchanged, so functionality is identical.
Changed components
internals/src/macros.rsInspect captured patch +1 / −4
diff --git a/internals/src/macros.rs b/internals/src/macros.rs
index 56a3aeb8..7de7193f 100644
--- a/internals/src/macros.rs
+++ b/internals/src/macros.rs
@@ -15,12 +15,9 @@ macro_rules! const_assert {
}
}
-/// Adds an implementation of `pub fn to_hex(&self) -> String` if `alloc` feature is enabled.
+/// Adds an implementation of `pub fn to_hex(&self) -> String`.
///
/// The added function allocates a `String` then calls through to [`core::fmt::LowerHex`].
-///
-/// Note: Calling this macro assumes that the calling crate has an `alloc` feature that also activates the
-/// `alloc` crate. Calling this macro without the `alloc` feature enabled is a no-op.
#[macro_export]
macro_rules! impl_to_hex_from_lower_hex {
($t:ident, $hex_len_fn:expr) => {
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.