Skip to content

Commit

Permalink
minor correction for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Jan 19, 2016
1 parent 7a56c01 commit 5c323ea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,9 @@ mod test {
fn list_system_addrs() -> Vec<IpAddr> {
list_system_interfaces("ifconfig", "").lines().filter_map(|line| {
println!("{}", line);
if line.contains("inet addr") {
let addr_s : Vec<&str> = line.split(":").collect();
let addr : Vec<&str> = addr_s[1].split(" ").collect();
return Some(IpAddr::V4(Ipv4Addr::from_str(addr[0]).ok().unwrap()));
if line.contains("inet ") {
let addr_s : Vec<&str> = line.split_whitespace().collect();
return Some(IpAddr::V4(Ipv4Addr::from_str(addr_s[1]).ok().unwrap()));
}
None
}).collect()
Expand Down

0 comments on commit 5c323ea

Please sign in to comment.