Skip to content

Commit

Permalink
Rename MacAddress None to Unset
Browse files Browse the repository at this point in the history
  • Loading branch information
jcronenberg committed Dec 5, 2023
1 parent 0e09c4a commit ecafa7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions rust/agama-dbus-server/src/network/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ pub enum MacAddress {
Random,
Stable,
#[default]
None,
Unset,
}

impl FromStr for MacAddress {
Expand All @@ -366,7 +366,7 @@ impl FromStr for MacAddress {
"permanent" => Ok(Self::Permanent),
"random" => Ok(Self::Random),
"stable" => Ok(Self::Stable),
"" => Ok(Self::None),
"" => Ok(Self::Unset),
_ => Ok(Self::MacAddress(match macaddr::MacAddr6::from_str(s) {
Ok(mac) => mac,
Err(e) => return Err(InvalidMacAddress(e.to_string())),
Expand All @@ -383,7 +383,7 @@ impl fmt::Display for MacAddress {
Self::Permanent => "permanent".to_string(),
Self::Random => "random".to_string(),
Self::Stable => "stable".to_string(),
Self::None => "".to_string(),
Self::Unset => "".to_string(),
};
write!(f, "{}", output)
}
Expand Down
8 changes: 4 additions & 4 deletions rust/agama-dbus-server/src/network/nm/dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ fn base_connection_from_dbus(conn: &OwnedNestedHash) -> Option<BaseConnection> {
Ok(mac) => mac,
Err(e) => {
log::warn!("Couldn't parse MAC: {}", e);
MacAddress::None
MacAddress::Unset
}
};
} else {
base_connection.mac_address = MacAddress::None;
base_connection.mac_address = MacAddress::Unset;
}
} else if let Some(wireless_config) = conn.get(WIRELESS_KEY) {
if let Some(mac_address) = wireless_config.get("assigned-mac-address") {
Expand All @@ -328,11 +328,11 @@ fn base_connection_from_dbus(conn: &OwnedNestedHash) -> Option<BaseConnection> {
Ok(mac) => mac,
Err(e) => {
log::warn!("Couldn't parse MAC: {}", e);
MacAddress::None
MacAddress::Unset
}
};
} else {
base_connection.mac_address = MacAddress::None;
base_connection.mac_address = MacAddress::Unset;
}
}

Expand Down

0 comments on commit ecafa7a

Please sign in to comment.