diff options
| author | Linus Färnstrand <faern@faern.net> | 2021-11-26 13:54:58 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2021-11-29 13:09:35 +0100 |
| commit | bc55e8482e45fa1a42a16078a80400cafb1a4258 (patch) | |
| tree | 16465e852163a01f8ef713321e1a629daed28764 /talpid-dbus | |
| parent | 0954877ceaa0ae9d63bc572b6a10088de1273fa7 (diff) | |
| download | mullvadvpn-bc55e8482e45fa1a42a16078a80400cafb1a4258.tar.xz mullvadvpn-bc55e8482e45fa1a42a16078a80400cafb1a4258.zip | |
Reformat code without blank_lines_upper_bound = 2
Diffstat (limited to 'talpid-dbus')
| -rw-r--r-- | talpid-dbus/src/lib.rs | 1 | ||||
| -rw-r--r-- | talpid-dbus/src/network_manager.rs | 6 | ||||
| -rw-r--r-- | talpid-dbus/src/systemd_resolved.rs | 2 |
3 files changed, 0 insertions, 9 deletions
diff --git a/talpid-dbus/src/lib.rs b/talpid-dbus/src/lib.rs index 50f3bafa1f..c4b9bb7e12 100644 --- a/talpid-dbus/src/lib.rs +++ b/talpid-dbus/src/lib.rs @@ -10,7 +10,6 @@ lazy_static::lazy_static! { static ref DBUS_CONNECTION: Mutex<Option<Arc<SyncConnection>>> = Mutex::new(None); } - /// Reuse or create a system DBus connection. pub fn get_connection() -> Result<Arc<SyncConnection>, dbus::Error> { let mut connection = DBUS_CONNECTION.lock().expect("DBus lock poisoned"); diff --git a/talpid-dbus/src/network_manager.rs b/talpid-dbus/src/network_manager.rs index 0edf764e26..55c28e65f1 100644 --- a/talpid-dbus/src/network_manager.rs +++ b/talpid-dbus/src/network_manager.rs @@ -108,7 +108,6 @@ pub enum Error { ObtainDevices, } - pub type VariantRefArg = Variant<Box<dyn RefArg>>; pub type VariantMap = HashMap<String, VariantRefArg>; // settings are a{sa{sv}} @@ -189,7 +188,6 @@ impl NetworkManager { .map_err(Error::Dbus)?; let device_path = device_paths.into_iter().next().ok_or(Error::NoDevice)?; - Ok(WireguardTunnel { config_path, connection_path, @@ -447,7 +445,6 @@ impl NetworkManager { let device_path = self.fetch_device(interface_name)?; self.wait_until_device_is_ready(&device_path)?; - let device = self.as_path(&device_path); // Get the last applied connection let (mut settings, version_id): ( @@ -639,7 +636,6 @@ impl NetworkManager { Err(Error::DeviceNotFound) } - pub fn convert_address_to_dbus(address: &IpAddr) -> VariantMap { let mut map: VariantMap = HashMap::new(); map.insert( @@ -692,7 +688,6 @@ impl WireguardTunnel { } } - pub fn device_is_ready(device_state: u32) -> bool { /// Any state above `NM_DEVICE_STATE_IP_CONFIG` is considered to be an OK state to change the /// DNS config. For the enums, see https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceState @@ -711,7 +706,6 @@ fn verify_etc_resolv_conf_contents() -> bool { eq_file_content(&expected_resolv_conf, &actual_resolv_conf) } - fn eq_file_content<P: AsRef<Path>>(a: &P, b: &P) -> bool { let file_a = match File::open(a).map(BufReader::new) { Ok(file) => file, diff --git a/talpid-dbus/src/systemd_resolved.rs b/talpid-dbus/src/systemd_resolved.rs index b593c589d4..7d0e915371 100644 --- a/talpid-dbus/src/systemd_resolved.rs +++ b/talpid-dbus/src/systemd_resolved.rs @@ -13,7 +13,6 @@ use std::{fs, io, net::IpAddr, path::Path, sync::Arc, time::Duration}; pub type Result<T> = std::result::Result<T, Error>; - #[derive(err_derive::Error, Debug)] #[error(no_from)] pub enum Error { @@ -221,7 +220,6 @@ impl SystemdResolved { } } - fn as_manager_object(&self) -> Proxy<'_, &SyncConnection> { Proxy::new( RESOLVED_BUS, |
