Skip to content

Commit b104f3a

Browse files
committed
Fix cloned_ref_to_slice_refs
1 parent 3e4b54c commit b104f3a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
453453
HTLCHandlingFailureType::Forward { node_id: Some(nodes[2].node.get_our_node_id()), channel_id: chan_1_2.2 },
454454
};
455455
expect_htlc_handling_failed_destinations!(
456-
nodes[1].node.get_and_clear_pending_events(), &[failed_destination.clone()]
456+
nodes[1].node.get_and_clear_pending_events(), core::slice::from_ref(&failed_destination)
457457
);
458458
match check {
459459
ForwardCheckFail::ForwardPayloadEncodedAsReceive => {
@@ -484,7 +484,7 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
484484
HTLCHandlingFailureType::Forward { node_id: Some(nodes[3].node.get_our_node_id()), channel_id: chan_2_3.2 },
485485
};
486486
expect_htlc_handling_failed_destinations!(
487-
nodes[2].node.get_and_clear_pending_events(), &[failed_destination.clone()]
487+
nodes[2].node.get_and_clear_pending_events(), core::slice::from_ref(&failed_destination)
488488
);
489489
check_added_monitors!(nodes[2], 1);
490490

lightning/src/ln/payment_tests.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,7 +3581,7 @@ fn no_extra_retries_on_back_to_back_fail() {
35813581
expect_and_process_pending_htlcs(&nodes[1], false);
35823582
expect_htlc_handling_failed_destinations!(
35833583
nodes[1].node.get_and_clear_pending_events(),
3584-
&[next_hop_failure.clone()]
3584+
core::slice::from_ref(&next_hop_failure)
35853585
);
35863586
check_added_monitors(&nodes[1], 1);
35873587

@@ -3755,7 +3755,7 @@ fn test_simple_partial_retry() {
37553755
HTLCHandlingFailureType::Forward { node_id: Some(node_c_id), channel_id: chan_2.2 };
37563756
expect_htlc_handling_failed_destinations!(
37573757
nodes[1].node.get_and_clear_pending_events(),
3758-
&[next_hop_failure.clone()]
3758+
core::slice::from_ref(&next_hop_failure)
37593759
);
37603760
check_added_monitors(&nodes[1], 2);
37613761

@@ -4247,7 +4247,10 @@ fn do_claim_from_closed_chan(fail_payment: bool) {
42474247
// We fail the HTLC on the A->B->D path first as it expires 4 blocks earlier. We go ahead
42484248
// and expire both immediately, though, by connecting another 4 blocks.
42494249
let reason = HTLCHandlingFailureType::Receive { payment_hash: hash };
4250-
expect_and_process_pending_htlcs_and_htlc_handling_failed(&nodes[3], &[reason.clone()]);
4250+
expect_and_process_pending_htlcs_and_htlc_handling_failed(
4251+
&nodes[3],
4252+
core::slice::from_ref(&reason),
4253+
);
42514254
connect_blocks(&nodes[3], 4);
42524255
expect_and_process_pending_htlcs_and_htlc_handling_failed(&nodes[3], &[reason]);
42534256

0 commit comments

Comments
 (0)