Skip to content

Commit

Permalink
improve lifetimes in split_leaders
Browse files Browse the repository at this point in the history
Co-authored-by: Illia Bobyr <ilya.bobyr@gmail.com>
  • Loading branch information
KirillLykov and ilya-bobyr committed Nov 7, 2024
1 parent c62f562 commit 2dc802c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tpu-client-next/src/connection_workers_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 2dc802c

Please sign in to comment.