Update macos.rs

main
shellrow 3 years ago
parent 72cbca957c
commit 85bb313187
  1. 12
      src/interface/macos.rs

@ -15,8 +15,16 @@ pub fn get_if_type_map() -> HashMap<String, InterfaceType> {
let mut map: HashMap<String, InterfaceType> = HashMap::new();
let interfaces = network_configuration::get_interfaces();
for interface in &interfaces {
let if_name: String = interface.bsd_name().unwrap().to_string();
let type_id: String = interface.interface_type_string().unwrap().to_string();
let if_name: String = if let Some(bsd_name) = interface.bsd_name() {
bsd_name.to_string()
}else{
continue;
};
let type_id: String = if let Some(type_string) = interface.interface_type_string() {
type_string.to_string()
}else{
continue;
};
map.insert(if_name, get_if_type_from_id(type_id));
}
return map;

Loading…
Cancel
Save