What changed, and why it matters
This commit is an automated code-formatting run by rustfmt. It only reorders import/use statements in two files without changing any program logic, behavior, or security properties.
No security action needed. This is a routine formatting commit and can be treated as non-security relevant.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff shows purely cosmetic reordering of use statements to satisfy rustfmt nightly formatting rules. In consensus_encoding/tests/decode.rs, a #[cfg(feature = 'hex')] import block is moved above another block. In crypto/src/key.rs, two alloc imports (alloc::format and alloc::string::ToString) are swapped. No functional code, signatures, cryptography, parsing, memory handling, or control flow is modified.
Changed components
Inspect captured patch +4 / −4
diff --git a/consensus_encoding/tests/decode.rs b/consensus_encoding/tests/decode.rs
index 936a4cde..2156019c 100644
--- a/consensus_encoding/tests/decode.rs
+++ b/consensus_encoding/tests/decode.rs
@@ -6,14 +6,14 @@
use std::io::{Cursor, Read};
use bitcoin_consensus_encoding as encoding;
+#[cfg(feature = "hex")]
+use bitcoin_consensus_encoding::{decode_from_hex, FromHexError};
#[cfg(feature = "alloc")]
use encoding::check_decode;
use encoding::{
check_decoder, decode_from_slice, decode_from_slice_unbounded, ArrayDecoder,
CompactSizeDecoder, Decode, DecodeError, Decoder, Decoder2, UnexpectedEofError,
};
-#[cfg(feature = "hex")]
-use bitcoin_consensus_encoding::{decode_from_hex, FromHexError};
#[cfg(feature = "std")]
use encoding::{decode_from_read, decode_from_read_unbuffered, ReadError};
#[cfg(feature = "alloc")]
diff --git a/crypto/src/key.rs b/crypto/src/key.rs
index f398b7aa..d36f1cf0 100644
--- a/crypto/src/key.rs
+++ b/crypto/src/key.rs
@@ -2098,10 +2098,10 @@ impl<'a> Arbitrary<'a> for XOnlyPublicKey {
mod tests {
#[cfg(feature = "hex")]
#[cfg(feature = "alloc")]
- use alloc::string::ToString;
+ use alloc::format;
#[cfg(feature = "hex")]
#[cfg(feature = "alloc")]
- use alloc::format;
+ use alloc::string::ToString;
#[cfg(feature = "hex")]
#[cfg(feature = "alloc")]
use alloc::vec;
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.