From 2dc802ce5eb6d641e77a3b7e52eeadc97ee52d7e Mon Sep 17 00:00:00 2001 From: kirill lykov Date: Thu, 7 Nov 2024 08:39:08 +0100 Subject: [PATCH] improve lifetimes in split_leaders Co-authored-by: Illia Bobyr --- tpu-client-next/src/connection_workers_scheduler.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tpu-client-next/src/connection_workers_scheduler.rs b/tpu-client-next/src/connection_workers_scheduler.rs index 3739b900179c19..8c40c647b5ba46 100644 --- a/tpu-client-next/src/connection_workers_scheduler.rs +++ b/tpu-client-next/src/connection_workers_scheduler.rs @@ -238,10 +238,10 @@ impl ConnectionWorkersScheduler { /// Splits the input vector of leaders into two parts based on the `fanout` configuration: /// * the first vector contains the leaders to which transactions will be sent. /// * the second vector contains the remaining leaders, used to warm up connections. -fn split_leaders<'a>( - leaders: &'a [SocketAddr], - fanout: &'a LeadersFanout, -) -> (&'a [SocketAddr], &'a [SocketAddr]) { +fn split_leaders<'leaders>( + leaders: &'leaders [SocketAddr], + fanout: &LeadersFanout, +) -> (&'leaders [SocketAddr], &'leaders [SocketAddr]) { let count = match fanout { LeadersFanout::All => leaders.len(), LeadersFanout::Next(count) => (*count).min(leaders.len()),