Skip to content

Commit d6da2f9

Browse files
committed
Merge rust-bitcoin#5459: Automated nightly rustfmt (2025-12-28)
f6f6345 2025-12-28 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: tcharding: ACK f6f6345 apoelstra: ACK f6f6345; successfully ran local tests Tree-SHA512: 8769d5e5f18ec83afa0d5e1beda860b7399891c92848c33b97b28a1cc571120bdab31717b3191c74701c1d293d9733d4a1eaad0c0674a729e6e775c8d5bef9b5
2 parents de55ae0 + f6f6345 commit d6da2f9

File tree

3 files changed

+23
-38
lines changed

3 files changed

+23
-38
lines changed

primitives/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#![doc(test(attr(warn(unused))))]
2020
// Package-specific lint overrides.
2121

22-
2322
#[cfg(feature = "alloc")]
2423
extern crate alloc;
2524

primitives/tests/api.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ fn api_can_use_units_modules_from_crate_root() {
211211

212212
#[test]
213213
fn api_can_use_units_types_from_crate_root() {
214-
use bitcoin_primitives::{Amount, BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval, FeeRate, NumOpResult, Sequence, BlockTime, BlockTimeDecoder, BlockTimeDecoderError, SignedAmount, Weight};
214+
use bitcoin_primitives::{
215+
Amount, BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval, BlockTime,
216+
BlockTimeDecoder, BlockTimeDecoderError, FeeRate, NumOpResult, Sequence, SignedAmount,
217+
Weight,
218+
};
215219
}
216220

217221
#[test]

units/tests/serde.rs

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
#![cfg(feature = "serde")]
77

88
use bincode::serialize;
9-
use bitcoin_units::{amount, fee_rate, Amount, BlockHeight, BlockHeightInterval, BlockTime, FeeRate, Sequence, SignedAmount, Weight};
10-
use serde::{Deserialize, Serialize};
11-
use bitcoin_units::absolute::{LockTime as AbsoluteLockTime, Height, MedianTimePast};
9+
use bitcoin_units::absolute::{Height, LockTime as AbsoluteLockTime, MedianTimePast};
1210
use bitcoin_units::relative::{LockTime as RelativeLockTime, NumberOf512Seconds, NumberOfBlocks};
11+
use bitcoin_units::{
12+
amount, fee_rate, Amount, BlockHeight, BlockHeightInterval, BlockTime, FeeRate, Sequence,
13+
SignedAmount, Weight,
14+
};
15+
use serde::{Deserialize, Serialize};
1316

1417
/// A struct that includes all the types that implement or support `serde` traits.
1518
#[derive(Debug, Serialize, Deserialize)]
@@ -300,14 +303,10 @@ fn serde_amount_as_str_opt() {
300303
}
301304

302305
#[track_caller]
303-
fn fee_rate_vb(vb: u32) -> FeeRate {
304-
FeeRate::from_sat_per_vb(vb)
305-
}
306+
fn fee_rate_vb(vb: u32) -> FeeRate { FeeRate::from_sat_per_vb(vb) }
306307

307308
#[track_caller]
308-
fn fee_rate_kwu(vb: u32) -> FeeRate {
309-
FeeRate::from_sat_per_kwu(vb)
310-
}
309+
fn fee_rate_kwu(vb: u32) -> FeeRate { FeeRate::from_sat_per_kwu(vb) }
311310

312311
#[test]
313312
#[cfg(feature = "serde")]
@@ -502,15 +501,12 @@ fn serde_fee_rate_as_sat_per_vb_ceil_opt() {
502501
#[cfg(feature = "serde")]
503502
#[cfg(feature = "alloc")]
504503
fn serde_as_block_height() {
505-
506504
#[derive(Serialize, Deserialize, PartialEq, Debug)]
507505
struct T {
508-
pub block_height: BlockHeight
506+
pub block_height: BlockHeight,
509507
}
510508

511-
let orig = T {
512-
block_height: BlockHeight::from_u32(123_456_789)
513-
};
509+
let orig = T { block_height: BlockHeight::from_u32(123_456_789) };
514510

515511
let json = "{\"block_height\": 123456789}";
516512

@@ -525,15 +521,12 @@ fn serde_as_block_height() {
525521
#[cfg(feature = "serde")]
526522
#[cfg(feature = "alloc")]
527523
fn serde_as_block_interval() {
528-
529524
#[derive(Serialize, Deserialize, PartialEq, Debug)]
530525
struct T {
531-
pub block_interval: BlockHeightInterval
526+
pub block_interval: BlockHeightInterval,
532527
}
533528

534-
let orig = T {
535-
block_interval: BlockHeightInterval::from_u32(144)
536-
};
529+
let orig = T { block_interval: BlockHeightInterval::from_u32(144) };
537530

538531
let json = "{\"block_interval\": 144}";
539532

@@ -548,15 +541,12 @@ fn serde_as_block_interval() {
548541
#[cfg(feature = "serde")]
549542
#[cfg(feature = "alloc")]
550543
fn serde_as_weight() {
551-
552544
#[derive(Serialize, Deserialize, PartialEq, Debug)]
553545
struct T {
554-
pub weight: Weight
546+
pub weight: Weight,
555547
}
556548

557-
let orig = T {
558-
weight: Weight::from_wu(25)
559-
};
549+
let orig = T { weight: Weight::from_wu(25) };
560550

561551
let json = "{\"weight\": 25}";
562552

@@ -571,15 +561,12 @@ fn serde_as_weight() {
571561
#[cfg(feature = "serde")]
572562
#[cfg(feature = "alloc")]
573563
fn serde_as_block_time() {
574-
575564
#[derive(Serialize, Deserialize, PartialEq, Debug)]
576565
struct T {
577-
pub block_time: BlockTime
566+
pub block_time: BlockTime,
578567
}
579568

580-
let orig = T {
581-
block_time: BlockTime::from_u32(123_456_789)
582-
};
569+
let orig = T { block_time: BlockTime::from_u32(123_456_789) };
583570

584571
let json = "{\"block_time\": 123456789}";
585572

@@ -594,15 +581,12 @@ fn serde_as_block_time() {
594581
#[cfg(feature = "serde")]
595582
#[cfg(feature = "alloc")]
596583
fn serde_as_sequence_from_hex() {
597-
598584
#[derive(Serialize, Deserialize, PartialEq, Debug)]
599585
struct T {
600-
pub sequence: Sequence
586+
pub sequence: Sequence,
601587
}
602588

603-
let orig = T {
604-
sequence: Sequence::from_hex("0x0040ffff").unwrap()
605-
};
589+
let orig = T { sequence: Sequence::from_hex("0x0040ffff").unwrap() };
606590

607591
let json = "{\"sequence\": 4259839}";
608592

@@ -617,7 +601,6 @@ fn serde_as_sequence_from_hex() {
617601
#[cfg(feature = "serde")]
618602
#[cfg(feature = "alloc")]
619603
fn serde_as_locktime_from_blocks() {
620-
621604
#[derive(Serialize, Deserialize, PartialEq, Debug)]
622605
struct T {
623606
pub a_lt: AbsoluteLockTime,
@@ -642,7 +625,6 @@ fn serde_as_locktime_from_blocks() {
642625
#[cfg(feature = "serde")]
643626
#[cfg(feature = "alloc")]
644627
fn serde_as_locktime_from_time() {
645-
646628
#[derive(Serialize, Deserialize, PartialEq, Debug)]
647629
struct T {
648630
pub a_lt: AbsoluteLockTime,

0 commit comments

Comments
 (0)