What changed, and why it matters
This is an automated code-formatting commit from rustfmt. It only changes whitespace, reorders imports, and breaks a long line. There are no functional changes and no security implications.
No action needed; this is a cosmetic formatting change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit applies rustfmt formatting: removes trailing whitespace in a test byte array in p2p/src/message.rs, reorders use statements in primitives/src/script/push_bytes.rs (alloc imports before core imports), and wraps a long let statement in primitives/src/witness_version.rs. No logic, API, or behavior changes are present.
Changed components
p2p/src/message.rsprimitives/src/script/push_bytes.rsprimitives/src/witness_version.rsInspect captured patch +8 / −8
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index 318cbde2..ef3b6804 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -2864,9 +2864,9 @@ mod test {
// Wire data has a non-canonical `send_compact` (0x12 instead of 0x01 or 0).
let raw_msg = [
0xf9, 0xbe, 0xb4, 0xd9,
- 0x73, 0x65, 0x6e, 0x64, 0x63, 0x6d, 0x70, 0x63, 0x74, 0x00, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00,
- 0xf9, 0x9c, 0x95, 0x43,
+ 0x73, 0x65, 0x6e, 0x64, 0x63, 0x6d, 0x70, 0x63, 0x74, 0x00, 0x00, 0x00,
+ 0x09, 0x00, 0x00, 0x00,
+ 0xf9, 0x9c, 0x95, 0x43,
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x0c, // Mode byte (0x12)
];
diff --git a/primitives/src/script/push_bytes.rs b/primitives/src/script/push_bytes.rs
index 359ce2cb..e9dfb6ac 100644
--- a/primitives/src/script/push_bytes.rs
+++ b/primitives/src/script/push_bytes.rs
@@ -2,14 +2,13 @@
//! Contains `PushBytes` & co
-use core::borrow::{Borrow, BorrowMut};
-use core::convert::Infallible;
-use core::ops::{Deref, DerefMut};
-
#[cfg(feature = "alloc")]
use alloc::borrow::ToOwned as _;
#[cfg(feature = "alloc")]
use alloc::boxed::Box;
+use core::borrow::{Borrow, BorrowMut};
+use core::convert::Infallible;
+use core::ops::{Deref, DerefMut};
#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
diff --git a/primitives/src/witness_version.rs b/primitives/src/witness_version.rs
index e689cb68..1ab9402c 100644
--- a/primitives/src/witness_version.rs
+++ b/primitives/src/witness_version.rs
@@ -85,7 +85,8 @@ impl FromStr for WitnessVersion {
type Err = ParseWitnessVersionError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
- let version: u8 = parse_int::int_from_str(s).map_err(ParseWitnessVersionError::Unparsable)?;
+ let version: u8 =
+ parse_int::int_from_str(s).map_err(ParseWitnessVersionError::Unparsable)?;
Self::try_from(version).map_err(ParseWitnessVersionError::Invalid)
}
}
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.