diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-07-30 13:23:17 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-07-30 13:23:17 +0200 |
| commit | 6b794ac1b3454d08a8efea71e912b4e7cbc6c9ee (patch) | |
| tree | cbd0ff3968aad4d897e5daf2c10bd46c34d03d12 /talpid-core | |
| parent | a9270436ab85bc01eb3313d72ce231008676d7f0 (diff) | |
| download | mullvadvpn-6b794ac1b3454d08a8efea71e912b4e7cbc6c9ee.tar.xz mullvadvpn-6b794ac1b3454d08a8efea71e912b4e7cbc6c9ee.zip | |
Reformat with rustfmt 0.9.0
Diffstat (limited to 'talpid-core')
| -rw-r--r-- | talpid-core/src/firewall/linux/mod.rs | 3 | ||||
| -rw-r--r-- | talpid-core/src/firewall/macos/dns.rs | 3 | ||||
| -rw-r--r-- | talpid-core/src/firewall/macos/mod.rs | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/talpid-core/src/firewall/linux/mod.rs b/talpid-core/src/firewall/linux/mod.rs index 67005516a3..f15617aba4 100644 --- a/talpid-core/src/firewall/linux/mod.rs +++ b/talpid-core/src/firewall/linux/mod.rs @@ -373,7 +373,8 @@ fn check_iface(rule: &mut Rule, direction: Direction, iface: &str) -> Result<()> } fn iface_index(name: &str) -> Result<libc::c_uint> { - let c_name = CString::new(name).chain_err(|| ErrorKind::InvalidInterfaceName(name.to_owned()))?; + let c_name = + CString::new(name).chain_err(|| ErrorKind::InvalidInterfaceName(name.to_owned()))?; let index = unsafe { libc::if_nametoindex(c_name.as_ptr()) }; if index == 0 { let error = io::Error::last_os_error(); diff --git a/talpid-core/src/firewall/macos/dns.rs b/talpid-core/src/firewall/macos/dns.rs index 2cde3cf8ff..5cadf3f58d 100644 --- a/talpid-core/src/firewall/macos/dns.rs +++ b/talpid-core/src/firewall/macos/dns.rs @@ -281,8 +281,7 @@ fn read_dns(store: &SCDynamicStore, path: CFString) -> Option<Vec<DnsServer>> { dictionary .find2(&CFString::from_static_string("ServerAddresses")) .map(|array_ptr| unsafe { CFType::wrap_under_get_rule(array_ptr) }) - }) - .and_then(|addresses| { + }).and_then(|addresses| { if let Some(array) = addresses.downcast::<CFArray<CFType>>() { parse_cf_array_to_strings(array) } else { diff --git a/talpid-core/src/firewall/macos/mod.rs b/talpid-core/src/firewall/macos/mod.rs index c4cb25f15b..0e6301c618 100644 --- a/talpid-core/src/firewall/macos/mod.rs +++ b/talpid-core/src/firewall/macos/mod.rs @@ -57,8 +57,8 @@ impl Firewall for PacketFilter { self.restore_state(), self.restore_dns(), ].into_iter() - .collect::<Result<Vec<_>>>() - .map(|_| ()) + .collect::<Result<Vec<_>>>() + .map(|_| ()) } } @@ -200,8 +200,7 @@ impl PacketFilter { let allow_multicast = rule_builder .to(pfctl::Ip::from(ipnetwork_compat(IpNetwork::V4( *super::MULTICAST_NET, - )))) - .build()?; + )))).build()?; rules.push(allow_net); rules.push(allow_multicast); } |
