(fix): only print valid data to stdout

A regression was introduced during the refactoring that makes rusolver print all the domains, even if they were invalid, this fixes that
Fixes #14
This commit is contained in:
Eduard Tolosa 2025-07-27 23:45:27 -05:00
parent 28b29ca515
commit 206c392fc0

View file

@ -89,12 +89,14 @@ pub async fn detect_wildcards(
}
pub fn print_domain_data(host: &str, domain_data: &DomainData, options: &LibOptions) {
if options.show_ip_address && !domain_data.is_wildcard {
if !domain_data.is_wildcard && !domain_data.ipv4_addresses.is_empty() {
if options.show_ip_address {
println!("{}:{:?}", host, domain_data.ipv4_addresses);
} else {
println!("{}", host);
}
}
}
pub fn return_resolver_opts(timeout: u64, retries: usize) -> ResolverOpts {
let mut options = ResolverOpts::default();