HOLY sweep

This commit is contained in:
lda
2026-04-04 07:14:52 +07:00 Unverified
parent 36025f96ca
commit 0b3baa4f1b
18 changed files with 37 additions and 29 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ pub async fn list_devs() -> HashSet<String> {
if e.file_type()
.map(|ft| {
if ft.is_symlink() {
std::fs::metadata(e.path()).map(|m| m.is_dir()).unwrap_or(false)
std::fs::metadata(e.path())
.map(|m| m.is_dir())
.unwrap_or(false)
} else {
ft.is_dir()
}
+2 -2
View File
@@ -1,7 +1,7 @@
pub mod dhcp;
pub mod devices;
pub mod dhcp;
pub mod wake;
pub use dhcp::*;
pub use devices::*;
pub use dhcp::*;
pub use wake::*;
+4 -4
View File
@@ -68,11 +68,11 @@ pub async fn wake_many(
.await?;
sock.set_broadcast(true)?;
let iter = targets.into_iter().map(async |target| {
match CompleteWakeTarget::try_from(target) {
let iter = targets
.into_iter()
.map(async |target| match CompleteWakeTarget::try_from(target) {
Ok(target) => wake_one(&sock, target).await,
Err(()) => WakeTargetResult::incomplete(target),
}
});
});
Ok(futures::future::join_all(iter).await)
}