From aa53cc13311293f4ea6ce9932bda2a1ec8e49495 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Sat, 19 Jul 2025 12:41:08 -0400 Subject: [PATCH 1/3] clippy: fix uninlined format args --- examples/example_wallet_electrum/src/main.rs | 11 +++---- .../example_wallet_esplora_async/src/main.rs | 9 ++---- .../src/main.rs | 9 ++---- examples/example_wallet_rpc/src/main.rs | 5 +--- wallet/examples/compiler.rs | 4 +-- wallet/examples/mnemonic_to_descriptors.rs | 4 +-- wallet/examples/policy.rs | 4 +-- wallet/src/descriptor/checksum.rs | 4 +-- wallet/src/descriptor/error.rs | 16 +++++----- wallet/src/descriptor/policy.rs | 6 ++-- wallet/src/keys/mod.rs | 6 ++-- wallet/src/wallet/coin_selection.rs | 12 +++----- wallet/src/wallet/error.rs | 30 +++++++++---------- wallet/src/wallet/mod.rs | 12 ++------ wallet/src/wallet/persisted.rs | 15 +++++----- wallet/src/wallet/signer.rs | 8 ++--- wallet/tests/build_fee_bump.rs | 10 +++---- wallet/tests/psbt.rs | 2 +- wallet/tests/wallet.rs | 6 ++-- 19 files changed, 73 insertions(+), 100 deletions(-) diff --git a/examples/example_wallet_electrum/src/main.rs b/examples/example_wallet_electrum/src/main.rs index 91ef5636..f27d1f03 100644 --- a/examples/example_wallet_electrum/src/main.rs +++ b/examples/example_wallet_electrum/src/main.rs @@ -39,7 +39,7 @@ fn main() -> Result<(), anyhow::Error> { let address = wallet.next_unused_address(KeychainKind::External); wallet.persist(&mut db)?; - println!("Generated Address: {}", address); + println!("Generated Address: {address}"); let balance = wallet.balance(); println!("Wallet balance before syncing: {}", balance.total()); @@ -56,9 +56,9 @@ fn main() -> Result<(), anyhow::Error> { let mut once = HashSet::::new(); move |k, spk_i, _| { if once.insert(k) { - print!("\nScanning keychain [{:?}]", k); + print!("\nScanning keychain [{k:?}]"); } - print!(" {:<3}", spk_i); + print!(" {spk_i:<3}"); stdout.flush().expect("must flush"); } }); @@ -74,10 +74,7 @@ fn main() -> Result<(), anyhow::Error> { println!("Wallet balance after syncing: {}", balance.total()); if balance.total() < SEND_AMOUNT { - println!( - "Please send at least {} to the receiving address", - SEND_AMOUNT - ); + println!("Please send at least {SEND_AMOUNT} to the receiving address"); std::process::exit(0); } diff --git a/examples/example_wallet_esplora_async/src/main.rs b/examples/example_wallet_esplora_async/src/main.rs index b6ab5d6d..a0c61369 100644 --- a/examples/example_wallet_esplora_async/src/main.rs +++ b/examples/example_wallet_esplora_async/src/main.rs @@ -50,9 +50,9 @@ async fn main() -> Result<(), anyhow::Error> { let mut once = BTreeSet::::new(); move |keychain, spk_i, _| { if once.insert(keychain) { - print!("\nScanning keychain [{:?}]", keychain); + print!("\nScanning keychain [{keychain:?}]"); } - print!(" {:<3}", spk_i); + print!(" {spk_i:<3}"); stdout.flush().expect("must flush") } }); @@ -69,10 +69,7 @@ async fn main() -> Result<(), anyhow::Error> { println!("Wallet balance after syncing: {}", balance.total()); if balance.total() < SEND_AMOUNT { - println!( - "Please send at least {} to the receiving address", - SEND_AMOUNT - ); + println!("Please send at least {SEND_AMOUNT} to the receiving address"); std::process::exit(0); } diff --git a/examples/example_wallet_esplora_blocking/src/main.rs b/examples/example_wallet_esplora_blocking/src/main.rs index 735f2a78..de1512ee 100644 --- a/examples/example_wallet_esplora_blocking/src/main.rs +++ b/examples/example_wallet_esplora_blocking/src/main.rs @@ -52,9 +52,9 @@ fn main() -> Result<(), anyhow::Error> { let mut once = BTreeSet::::new(); move |keychain, spk_i, _| { if once.insert(keychain) { - print!("\nScanning keychain [{:?}] ", keychain); + print!("\nScanning keychain [{keychain:?}] "); } - print!(" {:<3}", spk_i); + print!(" {spk_i:<3}"); stdout.flush().expect("must flush") } }); @@ -69,10 +69,7 @@ fn main() -> Result<(), anyhow::Error> { println!("Wallet balance after syncing: {}", balance.total()); if balance.total() < SEND_AMOUNT { - println!( - "Please send at least {} to the receiving address", - SEND_AMOUNT - ); + println!("Please send at least {SEND_AMOUNT} to the receiving address"); std::process::exit(0); } diff --git a/examples/example_wallet_rpc/src/main.rs b/examples/example_wallet_rpc/src/main.rs index 5526e666..dd65bb48 100644 --- a/examples/example_wallet_rpc/src/main.rs +++ b/examples/example_wallet_rpc/src/main.rs @@ -166,10 +166,7 @@ fn main() -> anyhow::Result<()> { wallet.apply_block_connected_to(&block_emission.block, height, connected_to)?; wallet.persist(&mut db)?; let elapsed = start_apply_block.elapsed().as_secs_f32(); - println!( - "Applied block {} at height {} in {}s", - hash, height, elapsed - ); + println!("Applied block {hash} at height {height} in {elapsed}s"); } Emission::Mempool(event) => { let start_apply_mempool = Instant::now(); diff --git a/wallet/examples/compiler.rs b/wallet/examples/compiler.rs index 86fb6774..3db1692f 100644 --- a/wallet/examples/compiler.rs +++ b/wallet/examples/compiler.rs @@ -45,7 +45,7 @@ fn main() -> Result<(), Box> { )" .replace(&[' ', '\n', '\t'][..], ""); - println!("Compiling policy: \n{}", policy_str); + println!("Compiling policy: \n{policy_str}"); // Parse the string as a [`Concrete`] type miniscript policy. let policy = Concrete::::from_str(&policy_str)?; @@ -54,7 +54,7 @@ fn main() -> Result<(), Box> { // `policy.compile()` returns the resulting miniscript from the policy. let descriptor = Descriptor::new_wsh(policy.compile()?)?.to_string(); - println!("Compiled into Descriptor: \n{}", descriptor); + println!("Compiled into Descriptor: \n{descriptor}"); // Create a new wallet from descriptors let mut wallet = Wallet::create_single(descriptor) diff --git a/wallet/examples/mnemonic_to_descriptors.rs b/wallet/examples/mnemonic_to_descriptors.rs index 19154c2d..3324d909 100644 --- a/wallet/examples/mnemonic_to_descriptors.rs +++ b/wallet/examples/mnemonic_to_descriptors.rs @@ -45,8 +45,8 @@ fn main() -> Result<(), anyhow::Error> { descriptor!(tr((mnemonic_with_passphrase, internal_path)))? .into_wallet_descriptor(&secp, Network::Testnet)?; - println!("tpub external descriptor: {}", external_descriptor); - println!("tpub internal descriptor: {}", internal_descriptor); + println!("tpub external descriptor: {external_descriptor}"); + println!("tpub internal descriptor: {internal_descriptor}"); println!( "tprv external descriptor: {}", external_descriptor.to_string_with_secret(&ext_keymap) diff --git a/wallet/examples/policy.rs b/wallet/examples/policy.rs index 4ceb47b7..969ff2db 100644 --- a/wallet/examples/policy.rs +++ b/wallet/examples/policy.rs @@ -42,7 +42,7 @@ fn main() -> Result<(), Box> { // But they can be used as independent tools also. let (wallet_desc, keymap) = desc.into_wallet_descriptor(&secp, Network::Testnet)?; - println!("Example Descriptor for policy analysis : {}", wallet_desc); + println!("Example Descriptor for policy analysis : {wallet_desc}"); // Create the signer with the keymap and descriptor. let signers_container = SignersContainer::build(keymap, &wallet_desc, &secp); @@ -54,7 +54,7 @@ fn main() -> Result<(), Box> { .extract_policy(&signers_container, BuildSatisfaction::None, &secp)? .expect("We expect a policy"); - println!("Derived Policy for the descriptor {:#?}", policy); + println!("Derived Policy for the descriptor {policy:#?}"); Ok(()) } diff --git a/wallet/src/descriptor/checksum.rs b/wallet/src/descriptor/checksum.rs index cd2305b9..ccdd58d4 100644 --- a/wallet/src/descriptor/checksum.rs +++ b/wallet/src/descriptor/checksum.rs @@ -76,11 +76,11 @@ mod test { #[test] fn test_calc_checksum_invalid_character() { let sparkle_heart = unsafe { core::str::from_utf8_unchecked(&[240, 159, 146, 150]) }; - let invalid_desc = format!("wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcL{}fjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)", sparkle_heart); + let invalid_desc = format!("wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcL{sparkle_heart}fjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"); assert_matches!( calc_checksum(&invalid_desc), - Err(DescriptorError::Miniscript(miniscript::Error::BadDescriptor(e))) if e == format!("Invalid character in checksum: '{}'", sparkle_heart) + Err(DescriptorError::Miniscript(miniscript::Error::BadDescriptor(e))) if e == format!("Invalid character in checksum: '{sparkle_heart}'") ); } } diff --git a/wallet/src/descriptor/error.rs b/wallet/src/descriptor/error.rs index e018b535..24909b7a 100644 --- a/wallet/src/descriptor/error.rs +++ b/wallet/src/descriptor/error.rs @@ -70,16 +70,16 @@ impl fmt::Display for Error { f, "The descriptor contains multipath keys, which are not supported yet" ), - Self::Key(err) => write!(f, "Key error: {}", err), - Self::Policy(err) => write!(f, "Policy error: {}", err), + Self::Key(err) => write!(f, "Key error: {err}"), + Self::Policy(err) => write!(f, "Policy error: {err}"), Self::InvalidDescriptorCharacter(char) => { - write!(f, "Invalid descriptor character: {}", char) + write!(f, "Invalid descriptor character: {char}") } - Self::Bip32(err) => write!(f, "BIP32 error: {}", err), - Self::Base58(err) => write!(f, "Base58 error: {}", err), - Self::Pk(err) => write!(f, "Key-related error: {}", err), - Self::Miniscript(err) => write!(f, "Miniscript error: {}", err), - Self::Hex(err) => write!(f, "Hex decoding error: {}", err), + Self::Bip32(err) => write!(f, "BIP32 error: {err}"), + Self::Base58(err) => write!(f, "Base58 error: {err}"), + Self::Pk(err) => write!(f, "Key-related error: {err}"), + Self::Miniscript(err) => write!(f, "Miniscript error: {err}"), + Self::Hex(err) => write!(f, "Hex decoding error: {err}"), Self::ExternalAndInternalAreTheSame => { write!(f, "External and internal descriptors are the same") } diff --git a/wallet/src/descriptor/policy.rs b/wallet/src/descriptor/policy.rs index 4250ed34..eb9014cb 100644 --- a/wallet/src/descriptor/policy.rs +++ b/wallet/src/descriptor/policy.rs @@ -250,7 +250,7 @@ where { let mut map = serializer.serialize_map(Some(input_map.len()))?; for (k, v) in input_map { - let k_string = format!("{:?}", k); + let k_string = format!("{k:?}"); map.serialize_entry(&k_string, v)?; } map.end() @@ -529,8 +529,8 @@ pub enum PolicyError { impl fmt::Display for PolicyError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::NotEnoughItemsSelected(err) => write!(f, "Not enough items selected: {}", err), - Self::IndexOutOfRange(index) => write!(f, "Index out of range: {}", index), + Self::NotEnoughItemsSelected(err) => write!(f, "Not enough items selected: {err}"), + Self::IndexOutOfRange(index) => write!(f, "Index out of range: {index}"), Self::AddOnLeaf => write!(f, "Add on leaf"), Self::AddOnPartialComplete => write!(f, "Add on partial complete"), Self::MixedTimelockUnits => write!(f, "Mixed timelock units"), diff --git a/wallet/src/keys/mod.rs b/wallet/src/keys/mod.rs index f239f45f..bf5c2023 100644 --- a/wallet/src/keys/mod.rs +++ b/wallet/src/keys/mod.rs @@ -989,9 +989,9 @@ impl fmt::Display for KeyError { Self::InvalidScriptContext => write!(f, "Invalid script context"), Self::InvalidNetwork => write!(f, "Invalid network"), Self::InvalidChecksum => write!(f, "Invalid checksum"), - Self::Message(err) => write!(f, "{}", err), - Self::Bip32(err) => write!(f, "BIP32 error: {}", err), - Self::Miniscript(err) => write!(f, "Miniscript error: {}", err), + Self::Message(err) => write!(f, "{err}"), + Self::Bip32(err) => write!(f, "BIP32 error: {err}"), + Self::Miniscript(err) => write!(f, "Miniscript error: {err}"), } } } diff --git a/wallet/src/wallet/coin_selection.rs b/wallet/src/wallet/coin_selection.rs index c3cc13f4..fa032fbd 100644 --- a/wallet/src/wallet/coin_selection.rs +++ b/wallet/src/wallet/coin_selection.rs @@ -783,8 +783,7 @@ mod test { fn foreign_utxo(value: Amount, index: u32) -> WeightedUtxo { assert!(index < 10); let outpoint = OutPoint::from_str(&format!( - "000000000000000000000000000000000000000000000000000000000000000{}:0", - index + "000000000000000000000000000000000000000000000000000000000000000{index}:0" )) .unwrap(); WeightedUtxo { @@ -811,8 +810,7 @@ mod test { ) -> WeightedUtxo { assert!(index < 10); let outpoint = OutPoint::from_str(&format!( - "000000000000000000000000000000000000000000000000000000000000000{}:0", - index + "000000000000000000000000000000000000000000000000000000000000000{index}:0" )) .unwrap(); WeightedUtxo { @@ -854,8 +852,7 @@ mod test { satisfaction_weight: Weight::from_wu_usize(P2WPKH_SATISFACTION_SIZE), utxo: Utxo::Local(LocalOutput { outpoint: OutPoint::from_str(&format!( - "ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:{}", - i + "ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:{i}" )) .unwrap(), txout: TxOut { @@ -894,8 +891,7 @@ mod test { satisfaction_weight: Weight::from_wu_usize(P2WPKH_SATISFACTION_SIZE), utxo: Utxo::Local(LocalOutput { outpoint: OutPoint::from_str(&format!( - "ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:{}", - i + "ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:{i}" )) .unwrap(), txout: TxOut { diff --git a/wallet/src/wallet/error.rs b/wallet/src/wallet/error.rs index 89e70eb8..47be69df 100644 --- a/wallet/src/wallet/error.rs +++ b/wallet/src/wallet/error.rs @@ -33,9 +33,9 @@ pub enum MiniscriptPsbtError { impl fmt::Display for MiniscriptPsbtError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Conversion(err) => write!(f, "Conversion error: {}", err), - Self::UtxoUpdate(err) => write!(f, "UTXO update error: {}", err), - Self::OutputUpdate(err) => write!(f, "Output update error: {}", err), + Self::Conversion(err) => write!(f, "Conversion error: {err}"), + Self::UtxoUpdate(err) => write!(f, "UTXO update error: {err}"), + Self::OutputUpdate(err) => write!(f, "Output update error: {err}"), } } } @@ -112,7 +112,7 @@ impl fmt::Display for CreateTxError { Self::Descriptor(e) => e.fmt(f), Self::Policy(e) => e.fmt(f), CreateTxError::SpendingPolicyRequired(keychain_kind) => { - write!(f, "Spending policy required: {}", keychain_kind) + write!(f, "Spending policy required: {keychain_kind}") } CreateTxError::Version0 => { write!(f, "Invalid version `0`") @@ -127,13 +127,12 @@ impl fmt::Display for CreateTxError { requested, required, } => { - write!(f, "TxBuilder requested timelock of `{}`, but at least `{}` is required to spend from this script", requested, required) + write!(f, "TxBuilder requested timelock of `{requested}`, but at least `{required}` is required to spend from this script") } CreateTxError::RbfSequenceCsv { sequence, csv } => { write!( f, - "Cannot enable RBF with nSequence `{}` given a required OP_CSV of `{}`", - sequence, csv + "Cannot enable RBF with nSequence `{sequence}` given a required OP_CSV of `{csv}`" ) } CreateTxError::FeeTooLow { required } => { @@ -152,7 +151,7 @@ impl fmt::Display for CreateTxError { write!(f, "No UTXO selected") } CreateTxError::OutputBelowDustLimit(limit) => { - write!(f, "Output below the dust limit: {}", limit) + write!(f, "Output below the dust limit: {limit}") } CreateTxError::CoinSelection(e) => e.fmt(f), CreateTxError::NoRecipients => { @@ -160,16 +159,16 @@ impl fmt::Display for CreateTxError { } CreateTxError::Psbt(e) => e.fmt(f), CreateTxError::MissingKeyOrigin(err) => { - write!(f, "Missing key origin: {}", err) + write!(f, "Missing key origin: {err}") } CreateTxError::UnknownUtxo => { write!(f, "UTXO not found in the internal database") } CreateTxError::MissingNonWitnessUtxo(outpoint) => { - write!(f, "Missing non_witness_utxo on foreign utxo {}", outpoint) + write!(f, "Missing non_witness_utxo on foreign utxo {outpoint}") } CreateTxError::MiniscriptPsbt(err) => { - write!(f, "Miniscript PSBT error: {}", err) + write!(f, "Miniscript PSBT error: {err}") } } } @@ -238,19 +237,18 @@ impl fmt::Display for BuildFeeBumpError { Self::TransactionNotFound(txid) => { write!( f, - "Transaction not found in the internal database with txid: {}", - txid + "Transaction not found in the internal database with txid: {txid}" ) } Self::TransactionConfirmed(txid) => { - write!(f, "Transaction already confirmed with txid: {}", txid) + write!(f, "Transaction already confirmed with txid: {txid}") } Self::IrreplaceableTransaction(txid) => { - write!(f, "Transaction can't be replaced with txid: {}", txid) + write!(f, "Transaction can't be replaced with txid: {txid}") } Self::FeeRateUnavailable => write!(f, "Fee rate unavailable"), Self::InvalidOutputIndex(op) => { - write!(f, "A txin referenced an invalid output: {}", op) + write!(f, "A txin referenced an invalid output: {op}") } } } diff --git a/wallet/src/wallet/mod.rs b/wallet/src/wallet/mod.rs index ed6cb3f9..b9d6e248 100644 --- a/wallet/src/wallet/mod.rs +++ b/wallet/src/wallet/mod.rs @@ -237,17 +237,12 @@ impl fmt::Display for LoadMismatch { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { LoadMismatch::Network { loaded, expected } => { - write!( - f, - "Network mismatch: loaded {}, expected {}", - loaded, expected - ) + write!(f, "Network mismatch: loaded {loaded}, expected {expected}") } LoadMismatch::Genesis { loaded, expected } => { write!( f, - "Genesis hash mismatch: loaded {}, expected {}", - loaded, expected + "Genesis hash mismatch: loaded {loaded}, expected {expected}" ) } LoadMismatch::Descriptor { @@ -306,8 +301,7 @@ impl fmt::Display for ApplyBlockError { connected_to_hash: checkpoint_hash, } => write!( f, - "`connected_to` hash {} differs from the expected hash {} (which is derived from `block`)", - checkpoint_hash, block_hash + "`connected_to` hash {checkpoint_hash} differs from the expected hash {block_hash} (which is derived from `block`)" ), } } diff --git a/wallet/src/wallet/persisted.rs b/wallet/src/wallet/persisted.rs index 48203cc4..74516e4b 100644 --- a/wallet/src/wallet/persisted.rs +++ b/wallet/src/wallet/persisted.rs @@ -365,7 +365,7 @@ pub enum CreateWithPersistError { impl fmt::Display for CreateWithPersistError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Persist(err) => write!(f, "{}", err), + Self::Persist(err) => write!(f, "{err}"), Self::DataAlreadyExists(changeset) => { write!( f, @@ -412,16 +412,15 @@ fn changeset_info(f: &mut fmt::Formatter<'_>, changeset: &ChangeSet) -> fmt::Res 0 }; - writeln!(f, " Network: {}", network)?; - writeln!(f, " Descriptor Checksum: {}", descriptor_checksum)?; + writeln!(f, " Network: {network}")?; + writeln!(f, " Descriptor Checksum: {descriptor_checksum}")?; writeln!( f, - " Change Descriptor Checksum: {}", - change_descriptor_checksum + " Change Descriptor Checksum: {change_descriptor_checksum}" )?; - writeln!(f, " Transaction Count: {}", tx_count)?; - writeln!(f, " Anchor Count: {}", anchor_count)?; - writeln!(f, " Block Count: {}", block_count)?; + writeln!(f, " Transaction Count: {tx_count}")?; + writeln!(f, " Anchor Count: {anchor_count}")?; + writeln!(f, " Block Count: {block_count}")?; Ok(()) } diff --git a/wallet/src/wallet/signer.rs b/wallet/src/wallet/signer.rs index 2af6b966..3aab2f5c 100644 --- a/wallet/src/wallet/signer.rs +++ b/wallet/src/wallet/signer.rs @@ -187,10 +187,10 @@ impl fmt::Display for SignerError { Self::MissingHdKeypath => write!(f, "Missing fingerprint and derivation path"), Self::NonStandardSighash => write!(f, "The psbt contains a non standard sighash"), Self::InvalidSighash => write!(f, "Invalid SIGHASH for the signing context in use"), - Self::SighashTaproot(err) => write!(f, "Error while computing the hash to sign a Taproot input: {}", err), - Self::Psbt(err) => write!(f, "Error computing the sighash: {}", err), - Self::MiniscriptPsbt(err) => write!(f, "Miniscript PSBT error: {}", err), - Self::External(err) => write!(f, "{}", err), + Self::SighashTaproot(err) => write!(f, "Error while computing the hash to sign a Taproot input: {err}"), + Self::Psbt(err) => write!(f, "Error computing the sighash: {err}"), + Self::MiniscriptPsbt(err) => write!(f, "Miniscript PSBT error: {err}"), + Self::External(err) => write!(f, "{err}"), } } } diff --git a/wallet/tests/build_fee_bump.rs b/wallet/tests/build_fee_bump.rs index d81b8d99..aa3613b1 100644 --- a/wallet/tests/build_fee_bump.rs +++ b/wallet/tests/build_fee_bump.rs @@ -79,7 +79,7 @@ fn test_bump_fee_low_fee_rate() { let required = feerate.to_sat_per_kwu() + 250; // +1 sat/vb let sat_vb = required as f64 / 250.0; - let expect = format!("Fee rate too low: required {} sat/vb", sat_vb); + let expect = format!("Fee rate too low: required {sat_vb} sat/vb"); assert_eq!(res.unwrap_err().to_string(), expect); } @@ -178,7 +178,7 @@ fn test_bump_fee_reduce_change() { assert_eq!(sent, original_sent_received.0); assert_eq!(received + fee, original_sent_received.1 + original_fee); - assert!(fee > original_fee, "{} > {}", fee, original_fee); + assert!(fee > original_fee, "{fee} > {original_fee}"); let tx = &psbt.unsigned_tx; assert_eq!(tx.output.len(), 2); @@ -365,7 +365,7 @@ fn test_bump_fee_remove_output_manually_selected_only() { ChainPosition::Confirmed { anchor, .. } => { insert_anchor(&mut wallet, init_tx.compute_txid(), anchor) } - other => panic!("all wallet txs must be confirmed: {:?}", other), + other => panic!("all wallet txs must be confirmed: {other:?}"), } let outpoint = OutPoint { @@ -415,7 +415,7 @@ fn test_bump_fee_add_input() { insert_tx(&mut wallet, init_tx); match pos { ChainPosition::Confirmed { anchor, .. } => insert_anchor(&mut wallet, txid, anchor), - other => panic!("all wallet txs must be confirmed: {:?}", other), + other => panic!("all wallet txs must be confirmed: {other:?}"), } let addr = Address::from_str("2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX") @@ -851,7 +851,7 @@ fn test_legacy_bump_fee_add_input() { insert_tx(&mut wallet, init_tx); match pos { ChainPosition::Confirmed { anchor, .. } => insert_anchor(&mut wallet, txid, anchor), - other => panic!("all wallet txs must be confirmed: {:?}", other), + other => panic!("all wallet txs must be confirmed: {other:?}"), } let addr = Address::from_str("2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX") diff --git a/wallet/tests/psbt.rs b/wallet/tests/psbt.rs index d34f7ec4..08c4acc9 100644 --- a/wallet/tests/psbt.rs +++ b/wallet/tests/psbt.rs @@ -167,7 +167,7 @@ fn test_psbt_multiple_internalkey_signers() { let secp = Secp256k1::new(); let wif = "cNJmN3fH9DDbDt131fQNkVakkpzawJBSeybCUNmP1BovpmGQ45xG"; - let desc = format!("tr({})", wif); + let desc = format!("tr({wif})"); let prv = PrivateKey::from_wif(wif).unwrap(); let keypair = Keypair::from_secret_key(&secp, &prv.inner); diff --git a/wallet/tests/wallet.rs b/wallet/tests/wallet.rs index 7d03d9fb..f40c9d45 100644 --- a/wallet/tests/wallet.rs +++ b/wallet/tests/wallet.rs @@ -34,8 +34,7 @@ fn test_error_external_and_internal_are_the_same() { .create_wallet_no_persist(); assert!( matches!(&err, Err(DescriptorError::ExternalAndInternalAreTheSame)), - "expected same descriptors error, got {:?}", - err, + "expected same descriptors error, got {err:?}", ); // public + private of same descriptor should fail to create wallet @@ -46,8 +45,7 @@ fn test_error_external_and_internal_are_the_same() { .create_wallet_no_persist(); assert!( matches!(err, Err(DescriptorError::ExternalAndInternalAreTheSame)), - "expected same descriptors error, got {:?}", - err, + "expected same descriptors error, got {err:?}", ); } From cbf0cfe59c3980fd07ee32d0acf67872dbe59bc1 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Sat, 19 Jul 2025 12:52:37 -0400 Subject: [PATCH 2/3] chore: update rust-version to 1.88.0 fixes #280 --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index f6342716..59be5921 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -1.87.0 +1.88.0 From d75126ef07d68e99cc0cdbbf6328df88b97e9955 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Wed, 30 Jul 2025 19:12:02 -0400 Subject: [PATCH 3/3] clippy: allow `uninlined_format_args` The lint should have stayed in "pedantic". The lint itself isn't helpful because it doesn't always improve readability, and inlining won't work if the argument is an expression or field access. --- wallet/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index d17cc468..f65fe653 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -7,6 +7,7 @@ )] #![no_std] #![warn(missing_docs)] +#![allow(clippy::uninlined_format_args)] #[cfg(feature = "std")] #[macro_use]