Skip to content

Automated nightly rustfmt (2025-06-15) #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions bitcoin/src/blockdata/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,7 @@ impl TransactionExtPriv for Transaction {
1
} else if witness_program.is_p2wsh() {
// Treat the last item of the witness as the witnessScript
witness
.last()
.map(Script::from_bytes)
.map(|s| s.count_sigops())
.unwrap_or(0)
witness.last().map(Script::from_bytes).map(|s| s.count_sigops()).unwrap_or(0)
} else {
0
}
Expand Down
12 changes: 6 additions & 6 deletions bitcoin/src/psbt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,11 @@ impl GetKey for $map<PublicKey, PrivateKey> {
KeyRequest::XOnlyPubkey(xonly) => {
let pubkey_even = xonly.public_key(secp256k1::Parity::Even);
let key = self.get(&pubkey_even).cloned();

if key.is_some() {
return Ok(key);
}

let pubkey_odd = xonly.public_key(secp256k1::Parity::Odd);
if let Some(priv_key) = self.get(&pubkey_odd).copied() {
let negated_priv_key = priv_key.negate();
Expand Down Expand Up @@ -928,18 +928,18 @@ impl GetKey for $map<XOnlyPublicKey, PrivateKey> {
KeyRequest::XOnlyPubkey(xonly) => Ok(self.get(xonly).cloned()),
KeyRequest::Pubkey(pk) => {
let (xonly, parity) = pk.inner.x_only_public_key();

if let Some(mut priv_key) = self.get(&XOnlyPublicKey::from(xonly)).cloned() {
let computed_pk = priv_key.public_key(&secp);
let (_, computed_parity) = computed_pk.inner.x_only_public_key();

if computed_parity != parity {
priv_key = priv_key.negate();
}

return Ok(Some(priv_key));
}

Ok(None)
},
KeyRequest::Bip32(_) => Err(GetKeyError::NotSupported),
Expand Down
4 changes: 3 additions & 1 deletion bitcoin/src/taproot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ impl TapTree {

/// Returns [`TapTreeIter<'_>`] iterator for a Taproot script tree, operating in DFS order over
/// tree [`ScriptLeaf`]s.
pub fn script_leaves(&self) -> ScriptLeaves<'_> { ScriptLeaves { leaf_iter: self.0.leaf_nodes() } }
pub fn script_leaves(&self) -> ScriptLeaves<'_> {
ScriptLeaves { leaf_iter: self.0.leaf_nodes() }
}

/// Returns the root [`TapNodeHash`] of this tree.
pub fn root_hash(&self) -> TapNodeHash { self.0.hash }
Expand Down
1 change: 0 additions & 1 deletion units/src/fee_rate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use core::ops;

#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};

use NumOpResult as R;

use crate::{Amount, MathOp, NumOpError as E, NumOpResult, Weight};
Expand Down