fix: avoid unwrap in mikrotik
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-28 21:55:07 +00:00
parent 396cb8a7ef
commit d316ccacd7

View File

@ -33,7 +33,7 @@ impl Router for MikrotikRouter {
async fn list_arp_entry(&self) -> Result<Vec<ArpEntry>> { async fn list_arp_entry(&self) -> Result<Vec<ArpEntry>> {
let rsp: Vec<MikrotikArpEntry> = self.api.req(Method::GET, "/rest/ip/arp", ()).await?; let rsp: Vec<MikrotikArpEntry> = self.api.req(Method::GET, "/rest/ip/arp", ()).await?;
Ok(rsp.into_iter().map(|e| e.try_into().unwrap()).collect()) Ok(rsp.into_iter().filter_map(|e| e.try_into().ok()).collect())
} }
async fn add_arp_entry(&self, entry: &ArpEntry) -> Result<ArpEntry> { async fn add_arp_entry(&self, entry: &ArpEntry) -> Result<ArpEntry> {