From 9d86cf15f0275ffeee4519bd054e3b61dc8992ac Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 26 Feb 2026 15:42:09 +0000 Subject: chore: apply cargo fmt and fix clippy warnings Fix pre-existing clippy lints: - &PathBuf -> &Path in audit_cleanup.rs - too_many_arguments on process_newly_available_git_data, process_purgatory_announcements, and HttpService::new - clone_on_copy for PublicKey (Copy type) in purgatory cleanup loop --- tests/sync/discovery.rs | 6 ++++-- tests/sync/maintainer_reprocessing.rs | 25 ++++++++++++++----------- tests/sync/metrics.rs | 19 ++++++++++++++----- 3 files changed, 32 insertions(+), 18 deletions(-) (limited to 'tests/sync') diff --git a/tests/sync/discovery.rs b/tests/sync/discovery.rs index d45a290..ee675e6 100644 --- a/tests/sync/discovery.rs +++ b/tests/sync/discovery.rs @@ -183,7 +183,10 @@ async fn test_relay_discovery_via_announcements_with_historic_sync() { let (announcement, _git_dir_a) = setup_announcement_on_relay(&relay_a, &keys, &domain_refs, repo_id).await; let announcement_id = announcement.id; - println!("Announcement {} set up on relay_a with git data (Layer 1)", announcement_id); + println!( + "Announcement {} set up on relay_a with git data (Layer 1)", + announcement_id + ); // Build repo coordinate for Layer 2 reference let repo_coord = repo_coord(&keys, repo_id); @@ -235,4 +238,3 @@ async fn test_relay_discovery_via_announcements_with_historic_sync() { issue_id ); } - diff --git a/tests/sync/maintainer_reprocessing.rs b/tests/sync/maintainer_reprocessing.rs index ff1eb43..9154ee5 100644 --- a/tests/sync/maintainer_reprocessing.rs +++ b/tests/sync/maintainer_reprocessing.rs @@ -70,17 +70,15 @@ async fn test_maintainer_announcement_reprocessed_immediately() { identifier )], ), - Tag::custom( - TagKind::custom("relays"), - vec![relay_a.url().to_string()], - ), + Tag::custom(TagKind::custom("relays"), vec![relay_a.url().to_string()]), ]) .sign_with_keys(&maintainer_keys) .unwrap(); - send_to_relay(&relay_a, &maintainer_announcement).await.unwrap(); + send_to_relay(&relay_a, &maintainer_announcement) + .await + .unwrap(); let _git_dir_maintainer = - push_git_data_to_relay(&relay_a, &maintainer_keys, identifier, &[&relay_a.domain()]) - .await; + push_git_data_to_relay(&relay_a, &maintainer_keys, identifier, &[&relay_a.domain()]).await; println!("✓ Maintainer announcement + git data pushed to relay_a"); // Step 2: Start relay_b with relay_a as bootstrap so its SyncManager connects immediately. @@ -134,7 +132,9 @@ async fn test_maintainer_announcement_reprocessed_immediately() { // re-processing of the maintainer announcement via our new code path. let _git_dir_owner = push_git_data_to_relay(&relay_b, &owner_keys, identifier, &[&relay_b.domain()]).await; - println!("✓ Owner git data pushed to relay_b (owner announcement promoted, hot cache re-processed)"); + println!( + "✓ Owner git data pushed to relay_b (owner announcement promoted, hot cache re-processed)" + ); // Step 5: Wait briefly for async processing to complete. tokio::time::sleep(Duration::from_secs(1)).await; @@ -363,9 +363,12 @@ async fn test_multiple_maintainers_all_reprocessed() { .kind(Kind::GitRepoAnnouncement) .author(keys.public_key()) .identifier(identifier); - let found = - wait_for_event_on_relay(relay_a.url(), filter, Duration::from_secs(10)).await; - assert!(found, "{} announcement should be in relay_a before starting relay_b", name); + let found = wait_for_event_on_relay(relay_a.url(), filter, Duration::from_secs(10)).await; + assert!( + found, + "{} announcement should be in relay_a before starting relay_b", + name + ); } println!("✓ All three maintainer announcements confirmed in relay_a's DB"); diff --git a/tests/sync/metrics.rs b/tests/sync/metrics.rs index e973bbb..996c8b7 100644 --- a/tests/sync/metrics.rs +++ b/tests/sync/metrics.rs @@ -417,9 +417,12 @@ async fn test_live_sync_event_count() { println!("Announcement set up on source relay with git data"); // Start syncing relay with pre-allocated port - let syncing_relay = - TestRelay::start_on_port_with_options(sync_port, Some(source_relay.url().to_string()), false) - .await; + let syncing_relay = TestRelay::start_on_port_with_options( + sync_port, + Some(source_relay.url().to_string()), + false, + ) + .await; println!("Syncing relay started at {}", syncing_relay.url()); // Wait for sync connection to be fully established with EOSE received @@ -458,8 +461,14 @@ async fn test_live_sync_event_count() { let client = TestClient::new(source_relay.url(), keys.clone()) .await .expect("Failed to connect to source"); - client.send_event(&patch1).await.expect("Failed to send patch 1"); - client.send_event(&patch2).await.expect("Failed to send patch 2"); + client + .send_event(&patch1) + .await + .expect("Failed to send patch 1"); + client + .send_event(&patch2) + .await + .expect("Failed to send patch 2"); client.disconnect().await; println!("Two patches sent to source relay (live mode)"); -- cgit v1.2.3