From: Valentine Wallace Date: Mon, 19 Dec 2022 20:27:29 +0000 (-0500) Subject: Remove unnecessary mut in finalize_claims X-Git-Tag: v0.0.114-beta~81^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=e69a4c2636ad2828377cf1df379e603c87989636;p=rust-lightning Remove unnecessary mut in finalize_claims --- diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index 68978c117..eacf46892 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -603,10 +603,10 @@ impl OutboundPayments { } } - pub(super) fn finalize_claims(&self, mut sources: Vec, pending_events: &Mutex>) { + pub(super) fn finalize_claims(&self, sources: Vec, pending_events: &Mutex>) { 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[..]);