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/http/landing.rs | 5 +---- src/http/mod.rs | 8 +++++++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/http') diff --git a/src/http/landing.rs b/src/http/landing.rs index 8ab4a68..5fc1e6e 100644 --- a/src/http/landing.rs +++ b/src/http/landing.rs @@ -341,10 +341,7 @@ fn generate_hero_tags(nip11: &RelayInformationDocument) -> String { // Add GRASP tags for grasp in &nip11.supported_grasps { - html.push_str(&format!( - r#"{}"#, - grasp - )); + html.push_str(&format!(r#"{}"#, grasp)); html.push('\n'); } diff --git a/src/http/mod.rs b/src/http/mod.rs index f584e03..91a6067 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -509,7 +509,13 @@ pub async fn run_server( loop { let (socket, addr) = listener.accept().await?; let io = TokioIo::new(socket); - let service = HttpService::new(relay.clone(), config.clone(), addr, database.clone(), metrics.clone()); + let service = HttpService::new( + relay.clone(), + config.clone(), + addr, + database.clone(), + metrics.clone(), + ); tokio::spawn(async move { if let Err(e) = http1::Builder::new() -- cgit v1.2.3