Skip to content

Commit 069c655

Browse files
Fmt Botgithub-actions[bot]
Fmt Bot
authored andcommitted
2025-05-25 automated rustfmt nightly
1 parent 1c07916 commit 069c655

File tree

4 files changed

+14
-28
lines changed

4 files changed

+14
-28
lines changed

bitcoin/src/psbt/mod.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,11 @@ impl GetKey for $map<PublicKey, PrivateKey> {
856856
KeyRequest::XOnlyPubkey(xonly) => {
857857
let pubkey_even = xonly.public_key(secp256k1::Parity::Even);
858858
let key = self.get(&pubkey_even).cloned();
859-
859+
860860
if key.is_some() {
861861
return Ok(key);
862862
}
863-
863+
864864
let pubkey_odd = xonly.public_key(secp256k1::Parity::Odd);
865865
if let Some(priv_key) = self.get(&pubkey_odd).copied() {
866866
let negated_priv_key = priv_key.negate();
@@ -893,18 +893,18 @@ impl GetKey for $map<XOnlyPublicKey, PrivateKey> {
893893
KeyRequest::XOnlyPubkey(xonly) => Ok(self.get(xonly).cloned()),
894894
KeyRequest::Pubkey(pk) => {
895895
let (xonly, parity) = pk.inner.x_only_public_key();
896-
896+
897897
if let Some(mut priv_key) = self.get(&XOnlyPublicKey::from(xonly)).cloned() {
898898
let computed_pk = priv_key.public_key(&secp);
899899
let (_, computed_parity) = computed_pk.inner.x_only_public_key();
900-
900+
901901
if computed_parity != parity {
902902
priv_key = priv_key.negate();
903903
}
904-
904+
905905
return Ok(Some(priv_key));
906906
}
907-
907+
908908
Ok(None)
909909
},
910910
KeyRequest::Bip32(_) => Err(GetKeyError::NotSupported),
@@ -1412,17 +1412,15 @@ mod tests {
14121412
Err(ABSURD_FEE_RATE)
14131413
);
14141414
assert_eq!(
1415-
psbt.clone()
1416-
.extract_tx_with_fee_rate_limit(JUST_BELOW_ABSURD_FEE_RATE)
1417-
.map_err(|e| match e {
1415+
psbt.clone().extract_tx_with_fee_rate_limit(JUST_BELOW_ABSURD_FEE_RATE).map_err(|e| {
1416+
match e {
14181417
ExtractTxError::AbsurdFeeRate { fee_rate, .. } => fee_rate,
14191418
_ => panic!(""),
1420-
}),
1419+
}
1420+
}),
14211421
Err(ABSURD_FEE_RATE)
14221422
);
1423-
assert!(psbt
1424-
.extract_tx_with_fee_rate_limit(ABSURD_FEE_RATE)
1425-
.is_ok());
1423+
assert!(psbt.extract_tx_with_fee_rate_limit(ABSURD_FEE_RATE).is_ok());
14261424

14271425
// Testing that extract_tx will error at 25k sat/vbyte (6250000 sat/kwu)
14281426
assert_eq!(

fuzz/fuzz_targets/bitcoin/p2p_address_roundtrip.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,17 @@ fn do_test(data: &[u8]) {
1919

2020
if let Ok(ip_addr) = IpAddr::try_from(addr_v2.clone()) {
2121
let round_trip: AddrV2 = AddrV2::from(ip_addr);
22-
assert_eq!(
23-
addr_v2, round_trip,
24-
"AddrV2 -> IpAddr -> AddrV2 should round-trip correctly"
25-
);
22+
assert_eq!(addr_v2, round_trip, "AddrV2 -> IpAddr -> AddrV2 should round-trip correctly");
2623
}
2724

2825
if let Ok(ip_addr) = Ipv4Addr::try_from(addr_v2.clone()) {
2926
let round_trip: AddrV2 = AddrV2::from(ip_addr);
30-
assert_eq!(
31-
addr_v2, round_trip,
32-
"AddrV2 -> Ipv4Addr -> AddrV2 should round-trip correctly"
33-
);
27+
assert_eq!(addr_v2, round_trip, "AddrV2 -> Ipv4Addr -> AddrV2 should round-trip correctly");
3428
}
3529

3630
if let Ok(ip_addr) = Ipv6Addr::try_from(addr_v2.clone()) {
3731
let round_trip: AddrV2 = AddrV2::from(ip_addr);
38-
assert_eq!(
39-
addr_v2, round_trip,
40-
"AddrV2 -> Ipv6Addr -> AddrV2 should round-trip correctly"
41-
);
32+
assert_eq!(addr_v2, round_trip, "AddrV2 -> Ipv6Addr -> AddrV2 should round-trip correctly");
4233
}
4334

4435
if let Ok(socket_addr) = SocketAddr::try_from(addr_v2.clone()) {

units/src/amount/error.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ impl fmt::Display for ParseDenominationError {
347347
#[cfg(feature = "std")]
348348
impl std::error::Error for ParseDenominationError {
349349
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
350-
351350
match *self {
352351
Self::Unknown(_) | Self::PossiblyConfusing(_) => None,
353352
}

units/src/locktime/absolute.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ impl ParseError {
377377
) -> fmt::Result {
378378
use core::num::IntErrorKind;
379379

380-
381380
match self {
382381
Self::ParseInt(ParseIntError { input, bits: _, is_signed: _, source })
383382
if *source.kind() == IntErrorKind::PosOverflow =>
@@ -425,7 +424,6 @@ impl ParseError {
425424
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
426425
use core::num::IntErrorKind;
427426

428-
429427
match self {
430428
Self::ParseInt(ParseIntError { source, .. })
431429
if *source.kind() == IntErrorKind::PosOverflow =>

0 commit comments

Comments
 (0)