Skip to content

Commit

Permalink
fixed a clippy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Dec 7, 2024
1 parent 75e17e1 commit 4e66c70
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions streamer/src/nonblocking/testing_utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,27 @@ pub struct SpawnTestServerResult {
}

pub fn create_quic_server_sockets() -> Vec<UdpSocket> {
let sockets = {
#[cfg(not(target_os = "windows"))]
{
use {
solana_net_utils::bind_to,
std::net::{IpAddr, Ipv4Addr},
};
(0..10)
.map(|_| {
bind_to(
IpAddr::V4(Ipv4Addr::LOCALHOST),
/*port*/ 0,
/*reuseport:*/ true,
)
.unwrap()
})
.collect::<Vec<_>>()
}
#[cfg(target_os = "windows")]
{
vec![bind_to_localhost().unwrap()]
}
};
sockets
#[cfg(not(target_os = "windows"))]
{
use {
solana_net_utils::bind_to,
std::net::{IpAddr, Ipv4Addr},
};
(0..10)
.map(|_| {
bind_to(
IpAddr::V4(Ipv4Addr::LOCALHOST),
/*port*/ 0,
/*reuseport:*/ true,
)
.unwrap()
})
.collect::<Vec<_>>()
}
#[cfg(target_os = "windows")]
{
vec![bind_to_localhost().unwrap()]
}
}

pub fn setup_quic_server(
Expand Down

0 comments on commit 4e66c70

Please sign in to comment.