From b8fd85aaf6986da5c3915b5a6e46c5852d208e5a Mon Sep 17 00:00:00 2001 From: Jorik Cronenberg Date: Mon, 24 Jun 2024 11:40:04 +0200 Subject: [PATCH] Fix rust fmt --- rust/agama-server/src/network/model.rs | 2 -- rust/agama-server/src/network/nm/dbus.rs | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/rust/agama-server/src/network/model.rs b/rust/agama-server/src/network/model.rs index 711618cb57..737afe6a16 100644 --- a/rust/agama-server/src/network/model.rs +++ b/rust/agama-server/src/network/model.rs @@ -1317,7 +1317,6 @@ impl fmt::Display for InfinibandTransportMode { } } - #[derive(Default, Debug, PartialEq, Clone, Serialize)] pub enum TunMode { #[default] @@ -1332,7 +1331,6 @@ pub struct TunConfig { pub owner: Option, } - /// Represents a network change. #[derive(Debug, Clone, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/rust/agama-server/src/network/nm/dbus.rs b/rust/agama-server/src/network/nm/dbus.rs index 03e468e731..b86853a8ad 100644 --- a/rust/agama-server/src/network/nm/dbus.rs +++ b/rust/agama-server/src/network/nm/dbus.rs @@ -547,9 +547,8 @@ fn infiniband_config_from_dbus(conn: &OwnedNestedHash) -> Option HashMap<&str, zvariant::Value> { - let mut tun_config: HashMap<&str, zvariant::Value> = HashMap::from([ - ("mode", Value::new(config.mode.clone() as u32)), - ]); + let mut tun_config: HashMap<&str, zvariant::Value> = + HashMap::from([("mode", Value::new(config.mode.clone() as u32))]); if let Some(group) = &config.group { tun_config.insert("group", group.into()); @@ -567,7 +566,6 @@ fn tun_config_from_dbus(conn: &OwnedNestedHash) -> Option { let mut tun_config = TunConfig::default(); - if let Some(mode) = tun.get("mode") { tun_config.mode = match mode.downcast_ref::()? { 2 => TunMode::Tap,