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 1, 2023
1 parent aa0d1b4 commit b4c798b
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 @@ -350,7 +350,7 @@ pub enum MacAddress {
Random,
Stable,
#[default]
None,
Unset,
}

impl FromStr for MacAddress {
Expand All @@ -362,7 +362,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 @@ -379,7 +379,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 @@ -306,11 +306,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 @@ -319,11 +319,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 b4c798b

Please sign in to comment.