From c9c70f9ff2d7ffa5ba3f85607ffe3336fc754b02 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 29 Jul 2026 17:23:06 +0000
Subject: [PATCH] style(clippy): group shared args into PrVoteCtx in
submit_pr_review.rs
Both check_self_approval and submit_vote had 8 parameters, exceeding
clippy::too_many_arguments limit of 7. Introduce a private PrVoteCtx
struct to bundle the five shared fields (client, base_url, encoded_repo,
pull_request_id, token), reducing each function to four parameters.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
src/safe_outputs/submit_pr_review.rs | 57 ++++++++++++++++++----------
1 file changed, 37 insertions(+), 20 deletions(-)
diff --git a/src/safe_outputs/submit_pr_review.rs b/src/safe_outputs/submit_pr_review.rs
index 8c63d6f4..6c5294cb 100644
--- a/src/safe_outputs/submit_pr_review.rs
+++ b/src/safe_outputs/submit_pr_review.rs
@@ -168,18 +168,31 @@ async fn fetch_authenticated_user_id(
Ok(Ok(user_id))
}
+/// Shared context for ADO PR vote API calls.
+struct PrVoteCtx<'a> {
+ client: &'a reqwest::Client,
+ base_url: &'a str,
+ encoded_repo: &'a str,
+ pull_request_id: i32,
+ token: &'a str,
+}
+
/// Self-approval guard: returns `Some(failure)` when a positive vote targets a PR the
/// authenticated user created; returns `None` when the vote is allowed to proceed.
async fn check_self_approval(
- client: &reqwest::Client,
- base_url: &str,
- encoded_repo: &str,
- pull_request_id: i32,
+ ctx: &PrVoteCtx<'_>,
user_id: &str,
event: &str,
vote_value: i32,
- token: &str,
) -> anyhow::Result