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 --- src/git/handlers.rs | 66 +++++++++++++++++++---------------------------------- src/git/sync.rs | 2 ++ 2 files changed, 26 insertions(+), 42 deletions(-) (limited to 'src/git') diff --git a/src/git/handlers.rs b/src/git/handlers.rs index 5ff3a7f..b615251 100644 --- a/src/git/handlers.rs +++ b/src/git/handlers.rs @@ -154,13 +154,10 @@ pub async fn handle_upload_pack( // Write request to git's stdin if let Some(mut stdin) = git.take_stdin() { - stdin - .write_all(&request_body) - .await - .map_err(|e| { - error!("Failed to write to git upload-pack stdin: {}", e); - GitError::IoError(e) - })?; + stdin.write_all(&request_body).await.map_err(|e| { + error!("Failed to write to git upload-pack stdin: {}", e); + GitError::IoError(e) + })?; // Close stdin to signal end of input drop(stdin); } @@ -171,24 +168,18 @@ pub async fn handle_upload_pack( if let Some(stdout) = git.take_stdout() { let mut stdout = stdout; - stdout - .read_to_end(&mut output) - .await - .map_err(|e| { - error!("Failed to read git upload-pack stdout: {}", e); - GitError::IoError(e) - })?; + stdout.read_to_end(&mut output).await.map_err(|e| { + error!("Failed to read git upload-pack stdout: {}", e); + GitError::IoError(e) + })?; } if let Some(stderr) = git.take_stderr() { let mut stderr = stderr; - stderr - .read_to_end(&mut stderr_output) - .await - .map_err(|e| { - error!("Failed to read git upload-pack stderr: {}", e); - GitError::IoError(e) - })?; + stderr.read_to_end(&mut stderr_output).await.map_err(|e| { + error!("Failed to read git upload-pack stderr: {}", e); + GitError::IoError(e) + })?; } // Wait for process @@ -317,13 +308,10 @@ pub async fn handle_receive_pack( // Write request to git's stdin if let Some(mut stdin) = git.take_stdin() { - stdin - .write_all(&request_body) - .await - .map_err(|e| { - error!("Failed to write to git receive-pack stdin: {}", e); - GitError::IoError(e) - })?; + stdin.write_all(&request_body).await.map_err(|e| { + error!("Failed to write to git receive-pack stdin: {}", e); + GitError::IoError(e) + })?; drop(stdin); } @@ -333,24 +321,18 @@ pub async fn handle_receive_pack( if let Some(stdout) = git.take_stdout() { let mut stdout = stdout; - stdout - .read_to_end(&mut output) - .await - .map_err(|e| { - error!("Failed to read git receive-pack stdout: {}", e); - GitError::IoError(e) - })?; + stdout.read_to_end(&mut output).await.map_err(|e| { + error!("Failed to read git receive-pack stdout: {}", e); + GitError::IoError(e) + })?; } if let Some(stderr) = git.take_stderr() { let mut stderr = stderr; - stderr - .read_to_end(&mut stderr_output) - .await - .map_err(|e| { - error!("Failed to read git receive-pack stderr: {}", e); - GitError::IoError(e) - })?; + stderr.read_to_end(&mut stderr_output).await.map_err(|e| { + error!("Failed to read git receive-pack stderr: {}", e); + GitError::IoError(e) + })?; } // Wait for process diff --git a/src/git/sync.rs b/src/git/sync.rs index 9a02ad4..05dcbda 100644 --- a/src/git/sync.rs +++ b/src/git/sync.rs @@ -814,6 +814,7 @@ pub fn extract_identifier_from_pr_event(event: &Event) -> Option { /// /// # Returns /// A `ProcessResult` describing what was processed +#[allow(clippy::too_many_arguments)] pub async fn process_newly_available_git_data( source_repo_path: &Path, new_oids: &HashSet, @@ -1339,6 +1340,7 @@ async fn process_purgatory_pr_events( /// When `write_policy` and `rejected_events_index` are provided (git push path), /// any maintainer announcements sitting in the hot cache are re-processed immediately /// after the owner announcement is promoted, so they don't wait for the next sync cycle. +#[allow(clippy::too_many_arguments)] async fn process_purgatory_announcements( identifier: &str, source_repo_path: &Path, -- cgit v1.2.3