From 2a9160836bb87fdea3ae891563b0169c68d1c2ab Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 11 Dec 2025 16:53:03 +0000 Subject: fix: resolve all fmt and clippy warnings Main lib (src/): - Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration) - Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting) - Replace .or_insert_with(RelaySyncNeeds::default) with .or_default() - Replace manual div_ceil implementations with .div_ceil(100) Test code (tests/): - Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...)) - Remove needless borrows in fetch_metrics() calls - Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module grasp-audit: - Apply cargo fmt to fix formatting --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 97a14eb..6d8b4dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,9 @@ async fn main() -> Result<()> { // Initialize metrics if enabled let metrics = if config.metrics_enabled { info!("Metrics enabled on /metrics endpoint"); - Some(Arc::new(Metrics::new(config.metrics_connection_per_ip_abuse_threshold))) + Some(Arc::new(Metrics::new( + config.metrics_connection_per_ip_abuse_threshold, + ))) } else { info!("Metrics disabled"); None @@ -65,7 +67,10 @@ async fn main() -> Result<()> { ); if config.sync_bootstrap_relay_url.is_some() { - info!("Starting proactive sync with bootstrap relay: {:?}", config.sync_bootstrap_relay_url); + info!( + "Starting proactive sync with bootstrap relay: {:?}", + config.sync_bootstrap_relay_url + ); } else { info!("Proactive sync enabled (will discover relays from stored announcements)"); } -- cgit v1.2.3