diff options
Diffstat (limited to 'talpid-core/src')
| -rw-r--r-- | talpid-core/src/firewall/macos/dns.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/talpid-core/src/firewall/macos/dns.rs b/talpid-core/src/firewall/macos/dns.rs index abf12353ab..1843cbe9d3 100644 --- a/talpid-core/src/firewall/macos/dns.rs +++ b/talpid-core/src/firewall/macos/dns.rs @@ -243,7 +243,8 @@ fn read_all_dns(store: &SCDynamicStore) -> HashMap<ServicePath, Option<Vec<DnsSe // Backup all "state" DNS, and all corresponding "setup" DNS even if they don't exist if let Some(paths) = store.get_keys(STATE_PATH_PATTERN) { for path_ptr in paths.as_untyped().iter() { - let state_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) }; + let state_path = + unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) }; let state_path_str = state_path.to_string(); let setup_path_str = state_to_setup_path(&state_path_str).unwrap(); let setup_path = CFString::new(&setup_path_str); @@ -254,7 +255,8 @@ fn read_all_dns(store: &SCDynamicStore) -> HashMap<ServicePath, Option<Vec<DnsSe // Backup all "setup" DNS not already covered if let Some(paths) = store.get_keys(SETUP_PATH_PATTERN) { for path_ptr in paths.as_untyped().iter() { - let setup_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) }; + let setup_path = + unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) }; let setup_path_str = setup_path.to_string(); if !backup.contains_key(&setup_path_str) { backup.insert(setup_path_str, read_dns(store, setup_path)); @@ -281,9 +283,7 @@ fn read_dns(store: &SCDynamicStore, path: CFString) -> Option<Vec<DnsServer>> { .and_then(|dictionary| { dictionary .find2(&CFString::from_static_string("ServerAddresses")) - .map(|array_ptr| unsafe { - CFType::wrap_under_get_rule(array_ptr) - }) + .map(|array_ptr| unsafe { CFType::wrap_under_get_rule(array_ptr) }) }) .and_then(|addresses: CFType| { if addresses.instance_of::<_, CFArray>() { @@ -305,7 +305,8 @@ fn parse_cf_string_array(array: CFArray) -> Option<Vec<String>> { for string_ptr in array.iter() { let cf_type = unsafe { CFType::wrap_under_get_rule(string_ptr) }; if cf_type.instance_of::<_, CFString>() { - let address = unsafe { CFString::wrap_under_get_rule(string_ptr as CFStringRef) }; + let address = + unsafe { CFString::wrap_under_get_rule(string_ptr as CFStringRef) }; strings.push(address.to_string()); } else { error!("DNS server entry is not a string: {:?}", cf_type); |
