Skip to content

Commit 6853503

Browse files
author
grtcdr
committed
Refactor obsolete find_ifa function
1 parent 29f9a0b commit 6853503

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/windows/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,10 @@ impl NetworkReadout for WindowsNetworkReadout {
457457
match interface {
458458
Some(it) => {
459459
if let Ok(addresses) = local_ip_address::list_afinet_netifas() {
460-
if let Some((_, ip)) = local_ip_address::find_ifa(addresses, it) {
461-
return Ok(ip.to_string());
460+
for (name, ip) in addresses.iter() {
461+
if let Some(name) = interface {
462+
return Ok(ip.to_string());
463+
}
462464
}
463465
}
464466
}

0 commit comments

Comments
 (0)