1 Commits
Author SHA1 Message Date
github-actions[bot]andGitHub 2c97a85054 Format Rust code using rustfmt
Rust static build and publish / Build static binary (x86_64-unknown-linux-musl, ubuntu-latest, linux-amd64) (push) Failing after 25s
Rust static build and publish / Build static binary (aarch64-apple-darwin, macos-latest, macos-arm64) (push) Has been cancelled
Rust static build and publish / Build static binary (x86_64-pc-windows-msvc, windows-latest, windows-amd64) (push) Has been cancelled
Rust static build and publish / Create Release Page (push) Has been cancelled
Rust static build and publish / Upload Release Assets (macos-latest, macos-arm64) (push) Has been cancelled
Rust static build and publish / Upload Release Assets (ubuntu-latest, linux-amd64) (push) Has been cancelled
Rust static build and publish / Upload Release Assets (windows-latest, windows-amd64) (push) Has been cancelled
2026-07-02 09:45:39 +00:00
+14 -6
View File
@@ -210,8 +210,9 @@ fn main() {
// Do DNS resolution in parallel but store results for ordered display later
let resolved_ips_with_indices = Arc::new(Mutex::new(Vec::<(String, IpAddr, usize)>::new()));
host_with_indices.par_iter().for_each(|(host, idx)| {
match lookup_host(&host.name) {
host_with_indices
.par_iter()
.for_each(|(host, idx)| match lookup_host(&host.name) {
Ok(ips) if !ips.is_empty() => {
let ip = ips[0];
let mut results = resolved_ips_with_indices.lock().unwrap();
@@ -219,14 +220,21 @@ fn main() {
}
Ok(_) => {
let mut results = resolved_ips_with_indices.lock().unwrap();
results.push((host.name.clone(), IpAddr::V4(std::net::Ipv4Addr::new(0, 0, 0, 0)), *idx));
results.push((
host.name.clone(),
IpAddr::V4(std::net::Ipv4Addr::new(0, 0, 0, 0)),
*idx,
));
}
Err(_) => {
let mut results = resolved_ips_with_indices.lock().unwrap();
results.push((host.name.clone(), IpAddr::V4(std::net::Ipv4Addr::new(0, 0, 0, 0)), *idx));
results.push((
host.name.clone(),
IpAddr::V4(std::net::Ipv4Addr::new(0, 0, 0, 0)),
*idx,
));
}
}
});
});
// Sort by original index to ensure hosts are displayed in order
let mut resolved_hosts = resolved_ips_with_indices.lock().unwrap().clone();