Skip to content

Commit

Permalink
Fix rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jcronenberg committed Jun 24, 2024
1 parent 64d1e62 commit b8fd85a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions rust/agama-server/src/network/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,6 @@ impl fmt::Display for InfinibandTransportMode {
}
}


#[derive(Default, Debug, PartialEq, Clone, Serialize)]
pub enum TunMode {
#[default]
Expand All @@ -1332,7 +1331,6 @@ pub struct TunConfig {
pub owner: Option<String>,
}


/// Represents a network change.
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down
6 changes: 2 additions & 4 deletions rust/agama-server/src/network/nm/dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,8 @@ fn infiniband_config_from_dbus(conn: &OwnedNestedHash) -> Option<InfinibandConfi
}

fn tun_config_to_dbus(config: &TunConfig) -> 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());
Expand All @@ -567,7 +566,6 @@ fn tun_config_from_dbus(conn: &OwnedNestedHash) -> Option<TunConfig> {

let mut tun_config = TunConfig::default();


if let Some(mode) = tun.get("mode") {
tun_config.mode = match mode.downcast_ref::<u32>()? {
2 => TunMode::Tap,
Expand Down

0 comments on commit b8fd85a

Please sign in to comment.