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 --- tests/sync/bootstrap.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/sync/bootstrap.rs') diff --git a/tests/sync/bootstrap.rs b/tests/sync/bootstrap.rs index 8a181c9..174fe28 100644 --- a/tests/sync/bootstrap.rs +++ b/tests/sync/bootstrap.rs @@ -167,7 +167,8 @@ async fn test_relay_replays_events_after_restart() { .kind(Kind::Custom(KIND_REPOSITORY_STATE)) .author(keys.public_key()); - let synced_first = wait_for_event_on_relay(relay_b.url(), filter.clone(), Duration::from_secs(5)).await; + let synced_first = + wait_for_event_on_relay(relay_b.url(), filter.clone(), Duration::from_secs(5)).await; println!("First sync check: {}", synced_first); // 8. Stop relay_b @@ -193,7 +194,8 @@ async fn test_relay_replays_events_after_restart() { // 12. Verify announcement is available on new relay_b // The announcement listed the OLD relay_b domain, but since relay_a still // has the event, new relay_b should be able to sync it via bootstrap - let synced_after_restart = wait_for_event_on_relay(relay_b_new.url(), filter, Duration::from_secs(5)).await; + let synced_after_restart = + wait_for_event_on_relay(relay_b_new.url(), filter, Duration::from_secs(5)).await; // 13. Cleanup relay_b_new.stop().await; @@ -384,7 +386,8 @@ async fn test_history_sync_without_negentropy() { relay_b_port, Some(relay_a.url().into()), true, // disable_negentropy = true - ).await; + ) + .await; println!( "relay_b started at {} (domain: {}) - negentropy DISABLED, will do HISTORY sync", relay_b.url(), -- cgit v1.2.3