summaryrefslogtreecommitdiffhomepage
path: root/talpid-core
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-12-04 11:12:49 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-12-04 12:19:36 +0100
commit6f3ea40d003400a4b5802f12e119805c7f9b3fb7 (patch)
tree7cdd9f74729e1aa473ce0ecae121784073a293f1 /talpid-core
parent26d9f85b9c779ca18f935df9006ca6fad037aeb7 (diff)
downloadmullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.tar.xz
mullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.zip
Upgrade rustfmt to 0.2.17
Diffstat (limited to 'talpid-core')
-rw-r--r--talpid-core/src/firewall/macos/dns.rs13
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);