Skip to content

Commit 3c5954e

Browse files
committed
Merge rust-bitcoin#5120: Automated nightly rustfmt (2025-10-12)
77fd364 2025-10-12 automated rustfmt nightly (Fmt Bot) Pull request description: Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action ACKs for top commit: apoelstra: ACK 77fd364; successfully ran local tests; not bad Tree-SHA512: f695cd1d7be25049710b1810a0487957848079b700d4ae5e1fb4f4725ab7c4910748876273b89f03788e48743cfec6606823f5d9e40c8a00d2550cbb9419eee7
2 parents edff6b0 + 77fd364 commit 3c5954e

File tree

8 files changed

+12
-24
lines changed

8 files changed

+12
-24
lines changed

bitcoin/src/blockdata/block.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,7 @@ mod tests {
657657
);
658658
assert_eq!(real_decode.total_size(), some_block.len());
659659
assert_eq!(block_base_size(real_decode.transactions()), some_block.len());
660-
assert_eq!(
661-
real_decode.weight(),
662-
Weight::from_vb_unchecked(some_block.len().to_u64())
663-
);
660+
assert_eq!(real_decode.weight(), Weight::from_vb_unchecked(some_block.len().to_u64()));
664661

665662
assert_eq!(serialize(&real_decode), some_block);
666663
}

bitcoin/src/blockdata/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ internal_macros::define_extension_trait! {
181181
/// Returns the total number of bytes that this input contributes to a transaction.
182182
///
183183
/// Total size includes the witness data (for base size see [`Self::base_size`]).
184-
///
184+
///
185185
/// # Panics
186186
///
187187
/// If the size calculation overflows.

consensus_encoding/src/encode/encoders.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ pub struct BytesEncoder<'sl> {
2626

2727
impl<'sl> BytesEncoder<'sl> {
2828
/// Constructs a byte encoder which encodes the given byte slice, with no length prefix.
29-
pub fn without_length_prefix(sl: &'sl [u8]) -> Self {
30-
Self { sl: Some(sl) }
31-
}
29+
pub fn without_length_prefix(sl: &'sl [u8]) -> Self { Self { sl: Some(sl) } }
3230
}
3331

3432
impl Encoder for BytesEncoder<'_> {
@@ -255,9 +253,7 @@ mod tests {
255253
where
256254
Self: 's;
257255

258-
fn encoder(&self) -> Self::Encoder<'_> {
259-
BytesEncoder::without_length_prefix(self.0)
260-
}
256+
fn encoder(&self) -> Self::Encoder<'_> { BytesEncoder::without_length_prefix(self.0) }
261257
}
262258

263259
struct TestArray<const N: usize>([u8; N]);
@@ -315,7 +311,6 @@ mod tests {
315311
assert_eq!(encoder.current_chunk(), None);
316312
}
317313

318-
319314
#[test]
320315
fn encode_slice_with_elements() {
321316
// Should have the element chunks, then exhausted.

fuzz/fuzz_targets/units/arbitrary_weight.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ fn do_test(data: &[u8]) {
3333
}
3434

3535
// Constructors that return a Weight
36-
for constructor in
37-
[Weight::from_wu]
38-
{
36+
for constructor in [Weight::from_wu] {
3937
if let Ok(val) = u.arbitrary() {
4038
constructor(val);
4139
} else {

hashes/src/sha256t/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ macro_rules! sha256t_tag_constructor {
192192

193193
#[cfg(test)]
194194
mod tests {
195-
use crate::sha256t;
196195
#[cfg(feature = "alloc")]
197196
use crate::sha256;
197+
use crate::sha256t;
198198

199199
const TEST_MIDSTATE: [u8; 32] = [
200200
156, 224, 228, 230, 124, 17, 108, 57, 56, 179, 202, 242, 195, 15, 80, 137, 211, 243, 147,

primitives/src/script/borrowed.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,10 @@ impl<T> Encodable for Script<T> {
165165
Self: 'a;
166166

167167
fn encoder(&self) -> Self::Encoder<'_> {
168-
ScriptEncoder(
169-
Encoder2::new(
170-
CompactSizeEncoder::new(self.as_bytes().len()),
171-
BytesEncoder::without_length_prefix(self.as_bytes())
172-
)
173-
)
168+
ScriptEncoder(Encoder2::new(
169+
CompactSizeEncoder::new(self.as_bytes().len()),
170+
BytesEncoder::without_length_prefix(self.as_bytes()),
171+
))
174172
}
175173
}
176174

units/src/amount/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use core::num::{NonZeroI64, NonZeroU64};
1111
use std::panic;
1212

1313
use super::*;
14-
use crate::result::NumOpResult;
1514
#[cfg(feature = "alloc")]
1615
use crate::result::MathOp;
16+
use crate::result::NumOpResult;
1717
#[cfg(feature = "alloc")]
1818
use crate::{FeeRate, Weight};
1919

units/src/weight.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Weight {
100100
pub const fn from_witness_data_size(witness_size: u64) -> Self { Weight::from_wu(witness_size) }
101101

102102
/// Constructs a new [`Weight`] from non-witness size.
103-
///
103+
///
104104
/// # Panics
105105
///
106106
/// If the conversion from virtual bytes overflows.

0 commit comments

Comments
 (0)