Skip to content

Commit b83b153

Browse files
committed
f Prefer split_at over split_off
1 parent b981410 commit b83b153

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning-transaction-sync/src/electrum.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,10 @@ where
248248
debug_assert_eq!(num_output_spend_lookups, sync_state.watched_outputs.len());
249249

250250
match self.client.batch_script_get_history(&watched_script_pubkeys) {
251-
Ok(mut tx_results) => {
252-
let output_results = tx_results.split_off(num_tx_lookups);
251+
Ok(results) => {
252+
let (tx_results, output_results) = results.split_at(num_tx_lookups);
253253
debug_assert_eq!(num_output_spend_lookups, output_results.len());
254+
254255
for (i, script_history) in tx_results.iter().enumerate() {
255256
let (txid, tx) = &watched_txs[i];
256257
let mut filtered_history = script_history.iter().filter(|h| h.tx_hash == **txid);

0 commit comments

Comments
 (0)