consensus_encoding: Split cfg(all(...)) into stacked attributes
What changed, and why it matters
This commit is a minor Rust code cleanup. It changes one line that previously required both the 'std' and 'alloc' features together into two separate feature checks stacked on top of each other. There is no functional or security change; the compiled result is the same.
No action needed. Treat as a non-security refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch replaces #[cfg(all(feature = "std", feature = "alloc"))] with two stacked #[cfg(...)] attributes for the same impl std::error::Error for ByteVecDecoderError block. In Rust, stacked #[cfg] attributes are combined with a logical AND, so the effective condition remains identical: both features must be enabled. This is purely a stylistic or tooling-compatibility refactor with no behavioral difference.
Changed components
consensus_encoding/src/error.rsInspect captured patch +2 / −1
diff --git a/consensus_encoding/src/error.rs b/consensus_encoding/src/error.rs
index 3c395b3e..e8a89021 100644
--- a/consensus_encoding/src/error.rs
+++ b/consensus_encoding/src/error.rs
@@ -227,7 +227,8 @@ impl fmt::Display for ByteVecDecoderError {
}
}
-#[cfg(all(feature = "std", feature = "alloc"))]
+#[cfg(feature = "alloc")]
+#[cfg(feature = "std")]
impl std::error::Error for ByteVecDecoderError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
use ByteVecDecoderErrorInner as E;
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.