Skip to content

Commit 654a724

Browse files
committed
f into_iter
1 parent 80354ac commit 654a724

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning-invoice/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,13 @@ where
381381
/// channel with a higher or equal inbound capacity than `min_inbound_capacity_msat` exists
382382
/// * If any public channel exists, the returned `RouteHint`s will be empty, and the sender will
383383
/// need to find the path by looking at the public channels instead
384-
fn filter_channels(mut channels: Vec<ChannelDetails>, min_inbound_capacity_msat: Option<u64>) -> Vec<RouteHint>{
384+
fn filter_channels(channels: Vec<ChannelDetails>, min_inbound_capacity_msat: Option<u64>) -> Vec<RouteHint>{
385385
let mut filtered_channels: HashMap<PublicKey, ChannelDetails> = HashMap::new();
386386
let min_inbound_capacity = min_inbound_capacity_msat.unwrap_or(0);
387387
let mut min_capacity_channel_exists = false;
388388
let mut online_channel_exists = false;
389389

390-
for channel in channels.drain(..).filter(|chan| chan.is_channel_ready) {
390+
for channel in channels.into_iter().filter(|chan| chan.is_channel_ready) {
391391
if channel.get_inbound_payment_scid().is_none() || channel.counterparty.forwarding_info.is_none() {
392392
continue;
393393
}

0 commit comments

Comments
 (0)