What changed, and why it matters
This is an automated code-formatting commit from rustfmt. It only changes whitespace, line breaks, import order, and other stylistic details. There are no functional changes and no security implications.
No action needed. This is a routine formatting commit with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit applies rustfmt nightly formatting across 8 files. Changes include collapsing multi-line expressions onto single lines, removing trailing blank lines, reordering imports alphabetically, and fixing whitespace in doc comments. No logic, API, or behavior changes are present.
Changed components
Inspect captured patch +12 / −24
diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs
index 7558beef..e36c94a9 100644
--- a/bitcoin/src/blockdata/block.rs
+++ b/bitcoin/src/blockdata/block.rs
@@ -657,10 +657,7 @@ mod tests {
);
assert_eq!(real_decode.total_size(), some_block.len());
assert_eq!(block_base_size(real_decode.transactions()), some_block.len());
- assert_eq!(
- real_decode.weight(),
- Weight::from_vb_unchecked(some_block.len().to_u64())
- );
+ assert_eq!(real_decode.weight(), Weight::from_vb_unchecked(some_block.len().to_u64()));
assert_eq!(serialize(&real_decode), some_block);
}
diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs
index 51210477..c8f37879 100644
--- a/bitcoin/src/blockdata/transaction.rs
+++ b/bitcoin/src/blockdata/transaction.rs
@@ -181,7 +181,7 @@ internal_macros::define_extension_trait! {
/// Returns the total number of bytes that this input contributes to a transaction.
///
/// Total size includes the witness data (for base size see [`Self::base_size`]).
- ///
+ ///
/// # Panics
///
/// If the size calculation overflows.
diff --git a/consensus_encoding/src/encode/encoders.rs b/consensus_encoding/src/encode/encoders.rs
index 0c346505..4b617edf 100644
--- a/consensus_encoding/src/encode/encoders.rs
+++ b/consensus_encoding/src/encode/encoders.rs
@@ -26,9 +26,7 @@ pub struct BytesEncoder<'sl> {
impl<'sl> BytesEncoder<'sl> {
/// Constructs a byte encoder which encodes the given byte slice, with no length prefix.
- pub fn without_length_prefix(sl: &'sl [u8]) -> Self {
- Self { sl: Some(sl) }
- }
+ pub fn without_length_prefix(sl: &'sl [u8]) -> Self { Self { sl: Some(sl) } }
}
impl Encoder for BytesEncoder<'_> {
@@ -255,9 +253,7 @@ mod tests {
where
Self: 's;
- fn encoder(&self) -> Self::Encoder<'_> {
- BytesEncoder::without_length_prefix(self.0)
- }
+ fn encoder(&self) -> Self::Encoder<'_> { BytesEncoder::without_length_prefix(self.0) }
}
struct TestArray<const N: usize>([u8; N]);
@@ -315,7 +311,6 @@ mod tests {
assert_eq!(encoder.current_chunk(), None);
}
-
#[test]
fn encode_slice_with_elements() {
// Should have the element chunks, then exhausted.
diff --git a/fuzz/fuzz_targets/units/arbitrary_weight.rs b/fuzz/fuzz_targets/units/arbitrary_weight.rs
index b50c917f..93ce2d82 100644
--- a/fuzz/fuzz_targets/units/arbitrary_weight.rs
+++ b/fuzz/fuzz_targets/units/arbitrary_weight.rs
@@ -33,9 +33,7 @@ fn do_test(data: &[u8]) {
}
// Constructors that return a Weight
- for constructor in
- [Weight::from_wu]
- {
+ for constructor in [Weight::from_wu] {
if let Ok(val) = u.arbitrary() {
constructor(val);
} else {
diff --git a/hashes/src/sha256t/mod.rs b/hashes/src/sha256t/mod.rs
index a0ca15d6..b8804791 100644
--- a/hashes/src/sha256t/mod.rs
+++ b/hashes/src/sha256t/mod.rs
@@ -192,9 +192,9 @@ macro_rules! sha256t_tag_constructor {
#[cfg(test)]
mod tests {
- use crate::sha256t;
#[cfg(feature = "alloc")]
use crate::sha256;
+ use crate::sha256t;
const TEST_MIDSTATE: [u8; 32] = [
156, 224, 228, 230, 124, 17, 108, 57, 56, 179, 202, 242, 195, 15, 80, 137, 211, 243, 147,
diff --git a/primitives/src/script/borrowed.rs b/primitives/src/script/borrowed.rs
index 31c962ea..940db85f 100644
--- a/primitives/src/script/borrowed.rs
+++ b/primitives/src/script/borrowed.rs
@@ -165,12 +165,10 @@ impl<T> Encodable for Script<T> {
Self: 'a;
fn encoder(&self) -> Self::Encoder<'_> {
- ScriptEncoder(
- Encoder2::new(
- CompactSizeEncoder::new(self.as_bytes().len()),
- BytesEncoder::without_length_prefix(self.as_bytes())
- )
- )
+ ScriptEncoder(Encoder2::new(
+ CompactSizeEncoder::new(self.as_bytes().len()),
+ BytesEncoder::without_length_prefix(self.as_bytes()),
+ ))
}
}
diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs
index 4a702e45..37e0770a 100644
--- a/units/src/amount/tests.rs
+++ b/units/src/amount/tests.rs
@@ -11,9 +11,9 @@ use core::num::{NonZeroI64, NonZeroU64};
use std::panic;
use super::*;
-use crate::result::NumOpResult;
#[cfg(feature = "alloc")]
use crate::result::MathOp;
+use crate::result::NumOpResult;
#[cfg(feature = "alloc")]
use crate::{FeeRate, Weight};
diff --git a/units/src/weight.rs b/units/src/weight.rs
index 4b67a2eb..95a6018b 100644
--- a/units/src/weight.rs
+++ b/units/src/weight.rs
@@ -100,7 +100,7 @@ impl Weight {
pub const fn from_witness_data_size(witness_size: u64) -> Self { Weight::from_wu(witness_size) }
/// Constructs a new [`Weight`] from non-witness size.
- ///
+ ///
/// # Panics
///
/// If the conversion from virtual bytes overflows.
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.