Skip to content

Commit

Permalink
Fix MAC address initialization from storage
Browse files Browse the repository at this point in the history
  • Loading branch information
swsnr committed Dec 11, 2024
1 parent 4891904 commit 418195d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/app/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use macaddr::MacAddr6;
use serde::{Deserialize, Serialize};

use crate::config::G_LOG_DOMAIN;
use crate::net::MacAddr6Boxed;

use super::model::Device;

Expand All @@ -32,14 +33,11 @@ pub struct StoredDevice {

impl From<StoredDevice> for Device {
fn from(value: StoredDevice) -> Self {
glib::Object::builder()
.property("label", value.label)
.property(
"mac_address",
glib::Bytes::from(value.mac_address.as_bytes()),
)
.property("host", value.host)
.build()
Device::new(
&value.label,
MacAddr6Boxed::from(value.mac_address),
&value.host,
)
}
}

Expand Down

0 comments on commit 418195d

Please sign in to comment.