Skip to content

Commit 9a250ba

Browse files
committed
chore: make clippy happy
1 parent 79b84be commit 9a250ba

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

crates/bdk/src/wallet/coin_selection.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ mod test {
836836
let drain_script = ScriptBuf::default();
837837
let target_amount = 250_000 + FEE_AMOUNT;
838838

839-
let result = LargestFirstCoinSelection::default()
839+
let result = LargestFirstCoinSelection
840840
.coin_select(
841841
utxos,
842842
vec![],
@@ -857,7 +857,7 @@ mod test {
857857
let drain_script = ScriptBuf::default();
858858
let target_amount = 20_000 + FEE_AMOUNT;
859859

860-
let result = LargestFirstCoinSelection::default()
860+
let result = LargestFirstCoinSelection
861861
.coin_select(
862862
utxos,
863863
vec![],
@@ -878,7 +878,7 @@ mod test {
878878
let drain_script = ScriptBuf::default();
879879
let target_amount = 20_000 + FEE_AMOUNT;
880880

881-
let result = LargestFirstCoinSelection::default()
881+
let result = LargestFirstCoinSelection
882882
.coin_select(
883883
vec![],
884884
utxos,
@@ -900,7 +900,7 @@ mod test {
900900
let drain_script = ScriptBuf::default();
901901
let target_amount = 500_000 + FEE_AMOUNT;
902902

903-
LargestFirstCoinSelection::default()
903+
LargestFirstCoinSelection
904904
.coin_select(
905905
vec![],
906906
utxos,
@@ -918,7 +918,7 @@ mod test {
918918
let drain_script = ScriptBuf::default();
919919
let target_amount = 250_000 + FEE_AMOUNT;
920920

921-
LargestFirstCoinSelection::default()
921+
LargestFirstCoinSelection
922922
.coin_select(
923923
vec![],
924924
utxos,
@@ -935,7 +935,7 @@ mod test {
935935
let drain_script = ScriptBuf::default();
936936
let target_amount = 180_000 + FEE_AMOUNT;
937937

938-
let result = OldestFirstCoinSelection::default()
938+
let result = OldestFirstCoinSelection
939939
.coin_select(
940940
vec![],
941941
utxos,
@@ -956,7 +956,7 @@ mod test {
956956
let drain_script = ScriptBuf::default();
957957
let target_amount = 20_000 + FEE_AMOUNT;
958958

959-
let result = OldestFirstCoinSelection::default()
959+
let result = OldestFirstCoinSelection
960960
.coin_select(
961961
utxos,
962962
vec![],
@@ -977,7 +977,7 @@ mod test {
977977
let drain_script = ScriptBuf::default();
978978
let target_amount = 20_000 + FEE_AMOUNT;
979979

980-
let result = OldestFirstCoinSelection::default()
980+
let result = OldestFirstCoinSelection
981981
.coin_select(
982982
vec![],
983983
utxos,
@@ -999,7 +999,7 @@ mod test {
999999
let drain_script = ScriptBuf::default();
10001000
let target_amount = 600_000 + FEE_AMOUNT;
10011001

1002-
OldestFirstCoinSelection::default()
1002+
OldestFirstCoinSelection
10031003
.coin_select(
10041004
vec![],
10051005
utxos,
@@ -1018,7 +1018,7 @@ mod test {
10181018
let target_amount: u64 = utxos.iter().map(|wu| wu.utxo.txout().value).sum::<u64>() - 50;
10191019
let drain_script = ScriptBuf::default();
10201020

1021-
OldestFirstCoinSelection::default()
1021+
OldestFirstCoinSelection
10221022
.coin_select(
10231023
vec![],
10241024
utxos,

crates/bdk/tests/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3181,7 +3181,7 @@ fn test_taproot_script_spend_sign_exclude_some_leaves() {
31813181
.values()
31823182
.map(|(script, version)| TapLeafHash::from_script(script, *version))
31833183
.collect();
3184-
let included_script_leaves = vec![script_leaves.pop().unwrap()];
3184+
let included_script_leaves = [script_leaves.pop().unwrap()];
31853185
let excluded_script_leaves = script_leaves;
31863186

31873187
assert!(

crates/chain/tests/test_keychain_txout_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ fn test_wildcard_derivations() {
312312
let _ = txout_index.reveal_to_target(&TestKeychain::External, 25);
313313

314314
(0..=15)
315-
.chain(vec![17, 20, 23].into_iter())
315+
.chain([17, 20, 23])
316316
.for_each(|index| assert!(txout_index.mark_used(&TestKeychain::External, index)));
317317

318318
assert_eq!(txout_index.next_index(&TestKeychain::External), (26, true));

crates/chain/tests/test_tx_graph.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -910,18 +910,15 @@ fn test_chain_spends() {
910910
let _ = graph.insert_tx(tx_1.clone());
911911
let _ = graph.insert_tx(tx_2.clone());
912912

913-
[95, 98]
914-
.iter()
915-
.zip([&tx_0, &tx_1].into_iter())
916-
.for_each(|(ht, tx)| {
917-
let _ = graph.insert_anchor(
918-
tx.txid(),
919-
ConfirmationHeightAnchor {
920-
anchor_block: tip.block_id(),
921-
confirmation_height: *ht,
922-
},
923-
);
924-
});
913+
for (ht, tx) in [(95, &tx_0), (98, &tx_1)] {
914+
let _ = graph.insert_anchor(
915+
tx.txid(),
916+
ConfirmationHeightAnchor {
917+
anchor_block: tip.block_id(),
918+
confirmation_height: ht,
919+
},
920+
);
921+
}
925922

926923
// Assert that confirmed spends are returned correctly.
927924
assert_eq!(

0 commit comments

Comments
 (0)