What changed, and why it matters
This is a routine automated code-formatting commit. It only reorders imports, removes blank lines, and collapses multi-line formatting to single-line formatting as directed by the rustfmt tool. There are no functional code changes, no bug fixes, and no security-related alterations.
No action required. This is a cosmetic formatting change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit applies rustfmt nightly formatting changes across five Rust source files. Changes include alphabetically reordering import statements (e.g., LegacyPublicKey, UntweakedPublicKey, TweakedPublicKey, PubkeyHash → LegacyPublicKey, PubkeyHash, TweakedPublicKey, UntweakedPublicKey), moving use crate::prelude::Vec, removing a blank line, and collapsing structurally formatted struct destructuring and builder chains onto single lines. No logic, API, or behavior changes are present.
Changed components
addresses/src/lib.rsbitcoin/src/blockdata/script/tests.rsconsensus_encoding/src/lib.rshashes/src/macros.rsp2p/src/message.rsInspect captured patch +8 / −17
diff --git a/addresses/src/lib.rs b/addresses/src/lib.rs
index bc940343..64a71b05 100644
--- a/addresses/src/lib.rs
+++ b/addresses/src/lib.rs
@@ -26,7 +26,7 @@ extern crate std;
pub mod witness_program;
#[cfg(feature = "alloc")]
-use crypto::key::{LegacyPublicKey, UntweakedPublicKey, TweakedPublicKey, PubkeyHash};
+use crypto::key::{LegacyPublicKey, PubkeyHash, TweakedPublicKey, UntweakedPublicKey};
#[cfg(feature = "alloc")]
use primitives::opcodes::all::{OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160};
#[cfg(feature = "alloc")]
@@ -35,7 +35,6 @@ use primitives::script::{Builder, PushBytes, ScriptBuf, ScriptPubKeyBuf};
use primitives::witness_version::WitnessVersion;
#[cfg(feature = "alloc")]
use taproot_primitives::{TapNodeHash, TapTweak as _};
-
#[cfg(feature = "alloc")]
use witness_program::WitnessProgram;
@@ -74,10 +73,7 @@ pub trait ScriptPubKeyBufExt: sealed::Sealed {
#[cfg(feature = "alloc")]
impl ScriptPubKeyBufExt for ScriptPubKeyBuf {
fn new_p2pk(pubkey: LegacyPublicKey) -> Self {
- Builder::new()
- .push_slice(pubkey.serialize())
- .push_opcode(OP_CHECKSIG)
- .into_script()
+ Builder::new().push_slice(pubkey.serialize()).push_opcode(OP_CHECKSIG).into_script()
}
fn new_p2pkh(pubkey_hash: PubkeyHash) -> Self {
diff --git a/bitcoin/src/blockdata/script/tests.rs b/bitcoin/src/blockdata/script/tests.rs
index 7b003330..bcad0b8b 100644
--- a/bitcoin/src/blockdata/script/tests.rs
+++ b/bitcoin/src/blockdata/script/tests.rs
@@ -7,12 +7,12 @@ use hex::hex;
use super::*;
use crate::crypto::key::{FullPublicKey, LegacyPublicKey, XOnlyPublicKey};
use crate::encoding::{decode_from_slice, encode_to_vec};
+use crate::prelude::Vec;
use crate::script::borrowed::{ScriptPubKeyExt as _, ScriptPubKeyExtPriv as _, TapScriptExt as _};
use crate::script::owned::ScriptSigBufExt as _;
use crate::script::witness_program::WitnessProgram;
use crate::script::witness_version::WitnessVersion;
use crate::{opcodes, Amount, FeeRate};
-use crate::prelude::Vec;
// Tests should compile and pass no matter what these are.
type Tag = primitives::script::ScriptSigTag;
diff --git a/consensus_encoding/src/lib.rs b/consensus_encoding/src/lib.rs
index 4ecd7e95..20b87a11 100644
--- a/consensus_encoding/src/lib.rs
+++ b/consensus_encoding/src/lib.rs
@@ -93,9 +93,6 @@ pub mod serde_as_consensus;
#[doc(inline)]
pub use self::compact_size::{CompactSizeDecoder, CompactSizeEncoder, CompactSizeU64Decoder};
-#[cfg(feature = "hex")]
-#[doc(inline)]
-pub use self::decode::{decode_from_hex, decode_from_hex_with_decoder};
#[doc(inline)]
pub use self::decode::decoders::{ArrayDecoder, Decoder2, Decoder3, Decoder4, Decoder6};
#[cfg(feature = "alloc")]
@@ -107,6 +104,9 @@ pub use self::decode::{
decode_from_slice_unbounded_with_decoder, decode_from_slice_with_decoder, Decode, Decoder,
DecoderStatus,
};
+#[cfg(feature = "hex")]
+#[doc(inline)]
+pub use self::decode::{decode_from_hex, decode_from_hex_with_decoder};
#[cfg(feature = "std")]
#[doc(inline)]
pub use self::decode::{
diff --git a/hashes/src/macros.rs b/hashes/src/macros.rs
index 9f3dbd83..57fca401 100644
--- a/hashes/src/macros.rs
+++ b/hashes/src/macros.rs
@@ -28,7 +28,7 @@
/// const MIDSTATE: sha256::Midstate = sha256::Midstate::hash_tag(b"foo");
/// }
/// ```
-///
+///
/// The macro's three constructors map to these `MIDSTATE` expressions:
///
/// - `hash_str("foo")` becomes `sha256::Midstate::hash_tag("foo".as_bytes())`
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index a1d9e967..3ef48f0f 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -1386,12 +1386,7 @@ impl encoding::Decoder for V1NetworkMessageDecoder {
.map_err(V1NetworkMessageDecoderErrorInner::Header)
.map_err(V1NetworkMessageDecoderError)
.expect_err("push_bytes() moves to ReadingPayload on header_decoder completion")),
- DecoderState::ReadingPayload {
- magic,
- checksum,
- payload_decoder,
- checksum_engine,
- } => {
+ DecoderState::ReadingPayload { magic, checksum, payload_decoder, checksum_engine } => {
let payload = payload_decoder.end()?;
let hash_bytes = checksum_engine.finalize().to_byte_array();
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.