What changed, and why it matters
This is a minor code cleanup commit. It moves one import statement behind a feature gate so that the Rust compiler's clippy lint tool no longer warns about an unused import when the library is built with no default features. There is no functional or security change.
No security action needed. Treat as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adjusts imports in consensus_encoding/tests/encode.rs. The Encodable trait is only used in code gated behind the ‘alloc’ feature, so the import is now also gated with #[cfg(feature = “alloc”)]. This suppresses an ‘unused import’ clippy warning in no-default-feature builds. The change is purely lint-driven and does not alter runtime behavior, test coverage, or consensus logic.
Changed components
consensus_encoding/tests/encode.rsInspect captured patch +3 / −1
diff --git a/consensus_encoding/tests/encode.rs b/consensus_encoding/tests/encode.rs
index 1c450d53..3409a2c9 100644
--- a/consensus_encoding/tests/encode.rs
+++ b/consensus_encoding/tests/encode.rs
@@ -5,7 +5,9 @@
#[cfg(feature = "std")]
use std::io::{Cursor, Write};
-use bitcoin_consensus_encoding::{ArrayEncoder, BytesEncoder, Encodable, Encoder};
+use bitcoin_consensus_encoding::{ArrayEncoder, BytesEncoder, Encoder};
+#[cfg(feature = "alloc")]
+use bitcoin_consensus_encoding::{Encodable};
// Simple test type that implements Encodable.
#[cfg(feature = "alloc")]
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.