Repository navigation
Remove redundant borrows from Rust guard labels - #16752
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The review reports no active issues, and the changes are limited to redundant-borrow cleanup and a test initializer simplification.
No open issues 🎉
What changed in this PR
This PR removes redundant Rust borrows from GitHub guard label computation and updates one test initializer to use struct update syntax, reducing Clippy warning noise without changing behavior.
Changes:
- Removes unnecessary borrows across repository, issue, pull request, governance, and response label helpers.
- Passes extracted issue references directly to author-association lookup.
- Initializes
PolicyContext.blocked_usersdirectly in the affected test.
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/labels/tool_rules.rs | Removes redundant borrows throughout repository, issue, pull request, governance, and content label computation. |
| guards/github-guard/rust-guard/src/labels/response_paths.rs | Removes an unnecessary borrow when computing project-item integrity labels. |
| guards/github-guard/rust-guard/src/labels/mod.rs | Uses struct update syntax to initialize blocked_users in the test policy context. |
| guards/github-guard/rust-guard/src/labels/backend.rs | Passes the extracted issue reference directly to author-association lookup. |
Review effort: Lite (adaptive)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No reaction, star, issue, comment, branch, file, or PR was created in any part. Result and detail logs written to
|
Rust guard label code produces 90
needless_borrowwarnings and one test-onlyfield_reassign_with_defaultwarning, obscuring actionable Clippy findings.PolicyContext.blocked_userswith struct update syntax instead of assigning afterdefault().