Skip to content

Commit

Permalink
Refactor obsolete find_ifa function
Browse files Browse the repository at this point in the history
  • Loading branch information
grtcdr committed Oct 6, 2023
1 parent 29f9a0b commit edc3959
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,10 @@ impl NetworkReadout for WindowsNetworkReadout {
match interface {
Some(it) => {
if let Ok(addresses) = local_ip_address::list_afinet_netifas() {
if let Some((_, ip)) = local_ip_address::find_ifa(addresses, it) {
return Ok(ip.to_string());
for (name, ip) in addresses.iter() {
if (interface == name) {

Check warning on line 461 in src/windows/mod.rs

View workflow job for this annotation

GitHub Actions / Windows (x86_64-pc-windows-msvc)

unnecessary parentheses around `if` condition

Check failure on line 461 in src/windows/mod.rs

View workflow job for this annotation

GitHub Actions / Windows (x86_64-pc-windows-msvc)

mismatched types
return Ok(ip.to_string());
}
}
}
}
Expand Down

0 comments on commit edc3959

Please sign in to comment.