From bf3e9471a6710ca19da2eff38f5cb35151edf787 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Tue, 9 Aug 2022 10:07:01 +0200 Subject: proposed modifications --- src/utils.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/utils.rs b/src/utils.rs index d851cf1..7b36aed 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -132,13 +132,10 @@ fn doctor(server_address_unclean: &str) { let ips: Vec = lookup_host(server_address).unwrap(); println!("Found {} IP addresses: ", ips.iter().count()); - for ip in ips.iter() { - println!(" - {}", ip); - } + ips.iter().for_each(|ip| println!(" - {ip}")); + + ips.iter().for_each(|ip| doctor_ip(*ip, Some(server_address))); - for ip in ips.iter() { - doctor_ip(*ip, Some(server_address)); - } } else { // user requested an ip address doctor_ip(server_ipaddr.unwrap(), None); -- cgit v1.2.3