Skip to content

Commit ef868cc

Browse files
committed
Use unwrap_or_else instead of expect
Clippy emits: warning: use of `expect` followed by a function call As suggested, use `unwrap_or_else` with `panic!`.
1 parent a1a5467 commit ef868cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bitcoind-tests/tests/test_cpp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn test_from_cpp_ms(cl: &Client, testdata: &TestData) {
215215
// Check whether the node accepts the transactions
216216
let txid = cl
217217
.send_raw_transaction(&tx)
218-
.expect(&format!("{} send tx failed for ms {}", i, ms));
218+
.unwrap_or_else(|_| panic!("{} send tx failed for ms {}", i, ms));
219219
spend_txids.push(txid);
220220
}
221221
}

bitcoind-tests/tests/test_desc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ pub fn test_desc_satisfy(
286286
// Check whether the node accepts the transactions
287287
let txid = cl
288288
.send_raw_transaction(&tx)
289-
.expect(&format!("send tx failed for desc {}", definite_desc));
289+
.unwrap_or_else(|_| panic!("send tx failed for desc {}", definite_desc));
290290

291291
// Finally mine the blocks and await confirmations
292292
let _blocks = cl

0 commit comments

Comments
 (0)