@@ -588,7 +588,7 @@ fn sort_and_filter_channels<L: Deref>(
588
588
channels : Vec < ChannelDetails > ,
589
589
min_inbound_capacity_msat : Option < u64 > ,
590
590
logger : & L ,
591
- ) -> Box < dyn Iterator < Item = RouteHint > >
591
+ ) -> impl Iterator < Item = RouteHint >
592
592
where
593
593
L :: Target : Logger ,
594
594
{
@@ -617,7 +617,7 @@ where
617
617
// look at the public channels instead.
618
618
log_trace ! ( logger, "Not including channels in invoice route hints on account of public channel {}" ,
619
619
log_bytes!( channel. channel_id) ) ;
620
- return Box :: new ( vec ! [ ] . into_iter ( ) ) ;
620
+ return vec ! [ ] . into_iter ( ) . take ( 3 ) . map ( route_hint_from_channel ) ;
621
621
}
622
622
}
623
623
@@ -689,7 +689,8 @@ where
689
689
cltv_expiry_delta: forwarding_info. cltv_expiry_delta,
690
690
htlc_minimum_msat: channel. inbound_htlc_minimum_msat,
691
691
htlc_maximum_msat: channel. inbound_htlc_maximum_msat, } ] )
692
- } ;
692
+
693
+ }
693
694
// If all channels are private, prefer to return route hints which have a higher capacity than
694
695
// the payment value and where we're currently connected to the channel counterparty.
695
696
// Even if we cannot satisfy both goals, always ensure we include *some* hints, preferring
@@ -740,7 +741,7 @@ where
740
741
b. inbound_capacity_msat . cmp ( & a. inbound_capacity_msat )
741
742
} } ) ;
742
743
743
- Box :: new ( eligible_channels. into_iter ( ) . take ( 3 ) . map ( route_hint_from_channel) )
744
+ eligible_channels. into_iter ( ) . take ( 3 ) . map ( route_hint_from_channel)
744
745
}
745
746
746
747
/// prefer_current_channel chooses a channel to use for route hints between a currently selected and candidate
0 commit comments