]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Remove unnecessary mut in finalize_claims
authorValentine Wallace <vwallace@protonmail.com>
Mon, 19 Dec 2022 20:27:29 +0000 (15:27 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Tue, 20 Dec 2022 02:04:58 +0000 (21:04 -0500)
lightning/src/ln/outbound_payment.rs

index 68978c117c5d0b062c5011b1e9f1487ced5c8c9e..eacf46892f565b4c1c65dfa551f8622decf8c1c0 100644 (file)
@@ -603,10 +603,10 @@ impl OutboundPayments {
                }
        }
 
-       pub(super) fn finalize_claims(&self, mut sources: Vec<HTLCSource>, pending_events: &Mutex<Vec<events::Event>>) {
+       pub(super) fn finalize_claims(&self, sources: Vec<HTLCSource>, pending_events: &Mutex<Vec<events::Event>>) {
                let mut outbounds = self.pending_outbound_payments.lock().unwrap();
                let mut pending_events = pending_events.lock().unwrap();
-               for source in sources.drain(..) {
+               for source in sources {
                        if let HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } = source {
                                let mut session_priv_bytes = [0; 32];
                                session_priv_bytes.copy_from_slice(&session_priv[..]);