Browse Source

proposed modifications

Paolo Asperti 3 years ago
parent
commit
bf3e9471a6
1 changed files with 3 additions and 6 deletions
  1. 3 6
      src/utils.rs

+ 3 - 6
src/utils.rs

@@ -132,13 +132,10 @@ fn doctor(server_address_unclean: &str) {
132 132
         let ips: Vec<std::net::IpAddr> = lookup_host(server_address).unwrap();
133 133
         println!("Found {} IP addresses: ", ips.iter().count());
134 134
 
135
-        for ip in ips.iter() {
136
-            println!(" - {}", ip);
137
-        }
135
+        ips.iter().for_each(|ip| println!(" - {ip}"));
136
+
137
+        ips.iter().for_each(|ip| doctor_ip(*ip, Some(server_address)));
138 138
 
139
-        for ip in ips.iter() {
140
-            doctor_ip(*ip, Some(server_address));
141
-        }
142 139
     } else {
143 140
         // user requested an ip address
144 141
         doctor_ip(server_ipaddr.unwrap(), None);