style: rustfmt the Wake-on-LAN modules

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-04 13:52:17 +02:00
parent fb709d68ce
commit 3545febbeb
7 changed files with 56 additions and 20 deletions
+5 -3
View File
@@ -154,9 +154,11 @@ pub fn learn_mac(fp_hex: &str, addr: &str, port: u16, mac: &[String]) {
return;
}
let mut known = KnownHosts::load();
let Some(h) = known.hosts.iter_mut().find(|h| {
(!fp_hex.is_empty() && h.fp_hex == fp_hex) || (h.addr == addr && h.port == port)
}) else {
let Some(h) = known
.hosts
.iter_mut()
.find(|h| (!fp_hex.is_empty() && h.fp_hex == fp_hex) || (h.addr == addr && h.port == port))
else {
return;
};
if h.mac == mac {
+8 -2
View File
@@ -319,7 +319,10 @@ fn rebuild(state: &Rc<State>) {
let online = adverts.values().any(|a| matches(k, a));
// Learn this host's wake MAC(s) from its live advert while it's online, so we can wake it
// once it sleeps and stops advertising (no-op / no disk write when unchanged).
if let Some(a) = adverts.values().find(|a| matches(k, a) && !a.mac.is_empty()) {
if let Some(a) = adverts
.values()
.find(|a| matches(k, a) && !a.mac.is_empty())
{
crate::trust::learn_mac(&k.fp_hex, &k.addr, k.port, &a.mac);
}
let recent = most_recent.as_deref() == Some(k.fp_hex.as_str());
@@ -505,7 +508,10 @@ fn saved_card(
// Explicit "just wake it" (the tap-to-connect already auto-wakes an offline host).
let mac = k.mac.clone();
let addr = k.addr.clone();
add("wake", Box::new(move || crate::wol::wake(&mac, addr.parse().ok())));
add(
"wake",
Box::new(move || crate::wol::wake(&mac, addr.parse().ok())),
);
}
overlay.insert_action_group("card", Some(&actions));