fmt
release / build (push) Successful in 1m52s

This commit is contained in:
lda
2025-09-28 16:09:12 +07:00 Unverified
parent 9ffe4fc85b
commit fabf67297e
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -1,6 +1,9 @@
use crate::{
arpparse::NUDState,
utils::{parse::{de_many, serialize_macs}, query::get_macs},
utils::{
parse::{de_many, serialize_macs},
query::get_macs,
},
};
use axum::{Json, http::StatusCode, response::IntoResponse};
use axum_extra::extract::Query;
@@ -96,7 +99,8 @@ pub async fn get_status_json(
// can we jus collect the whole table instead of doing this.
for d in &dev_opts {
for n in &nud_opts {
tasks.push(get_macs( // this i hate sm
tasks.push(get_macs(
// this i hate sm
name.as_deref(),
ips_opt.as_deref(),
d.as_deref(),
@@ -110,7 +114,8 @@ pub async fn get_status_json(
.map(|v| v.into_iter().flatten().collect::<Vec<_>>())
{
Ok(mut table) => {
if !mac.is_empty() { // mac here
if !mac.is_empty() {
// mac here
let wanted: HashSet<MacAddr> = mac.into_iter().collect();
table.retain(|row| row.mac.map(|m| wanted.contains(&m)).unwrap_or(false));
}
+1 -1
View File
@@ -136,7 +136,7 @@ pub async fn get_mac(
Ok(rows)
}
/*
/*
/// get macs where you just run ip neigh then rust handles the filtering (faster than get mac)
pub async fn get_macs_rust(
machine_names: Option<&str>,