apply clippy optimizations

This commit is contained in:
yggverse 2025-08-16 16:40:21 +03:00
parent 796b5bf4e8
commit a4f82e8bbc

View file

@ -64,18 +64,17 @@ fn crawl(
for (host, peers) in p.response.unwrap() {
for port in &config.port {
let address = SocketAddr::new(IpAddr::V6(host), *port);
if let Some(index) = tcp {
if !index.contains(&address) {
let url = format!("tcp://{address}");
if TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_ok()
if let Some(index) = tcp
&& !index.contains(&address)
{
let url = format!("tcp://{address}");
if TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_ok() {
println!("\t{}: {url}", SUCCESS.green())
} else if config.debug {
println!("\t{}: {url}", FAILURE.red());
}
index.push(address)
}
}
if let Some((index, server)) = udp {
let url = format!("udp://{address}");
if !index.contains(&address) {