From 2b9e761d9e8085174e885961c7929b97394734ae Mon Sep 17 00:00:00 2001 From: Gitea-Bot Date: Mon, 14 Sep 2026 22:51:40 +0000 Subject: [PATCH] Style: Automatische Formatierung & Clippy-Fixes --- src/cache.rs | 15 ++++----------- src/resolver.rs | 5 +---- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/cache.rs b/src/cache.rs index a120525..5493df1 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -157,9 +157,8 @@ pub fn is_expired(updated_at: i64, now: i64, ttl_seconds: u64) -> bool { fn ensure_cache_dir(dir: &Path) -> Result<(), String> { if !dir.exists() { - std::fs::create_dir_all(dir).map_err(|e| { - format!("could not create directory '{}': {e}", dir.display()) - })?; + std::fs::create_dir_all(dir) + .map_err(|e| format!("could not create directory '{}': {e}", dir.display()))?; // create_dir_all() unterliegt dem Prozess-Umask; explizites chmod ist nötig, um // wirklich 0777 zu erreichen (Verzeichnis-Rechte steuern nicht die Umask neuer Dateien). // Wird nur beim Neuanlegen ausgeführt; bei existierenden Verzeichnissen würde ein @@ -198,10 +197,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option { { Ok(db) => db, Err(e) => { - crate::log::warn( - "cache", - &format!("Could not open cache database: {e}"), - ); + crate::log::warn("cache", &format!("Could not open cache database: {e}")); return None; } }; @@ -216,10 +212,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option { let cache = Cache { conn }; if let Err(e) = cache.init_schema().await { - crate::log::warn( - "cache", - &format!("Could not initialize cache schema: {e}"), - ); + crate::log::warn("cache", &format!("Could not initialize cache schema: {e}")); return None; } diff --git a/src/resolver.rs b/src/resolver.rs index be09ceb..ab4a096 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -55,10 +55,7 @@ pub async fn resolve( && !cache::is_expired(entry.updated_at, now, config.cache_ttl_seconds) && network::ping_check(entry.ip).await { - crate::log::info( - "resolver", - &format!("Cache hit for {mac}: {}", entry.ip), - ); + crate::log::info("resolver", &format!("Cache hit for {mac}: {}", entry.ip)); return Ok(ResolveResult { mac: *mac, ip: entry.ip,