Repository navigation
[Repo Assist] refactor(rust-guard): remove needless_borrow clippy warnings - #16670
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies only mechanical borrow and test-fixture cleanups, with the reported Clippy warnings addressed and no active issues noted.
No open issues 🎉
What changed in this PR
This pull request performs a mechanical Rust cleanup in the GitHub guard label-processing code by removing redundant borrows and simplifying a test fixture without changing behavior.
Changes:
- Removes unnecessary borrows in tool, backend, and response-path labeling code.
- Uses struct-update syntax for the
PolicyContexttest fixture. - Eliminates the reported Clippy warnings.
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/labels/tool_rules.rs | Removes redundant borrows across tool-specific label rules. |
| guards/github-guard/rust-guard/src/labels/response_paths.rs | Removes an unnecessary borrow when generating project-item integrity labels. |
| guards/github-guard/rust-guard/src/labels/mod.rs | Uses struct-update syntax for the PolicyContext test fixture. |
| guards/github-guard/rust-guard/src/labels/backend.rs | Removes an unnecessary borrow when extracting issue author association. |
Review effort: Lite (adaptive)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write, reaction, star, issue, comment, branch, file, or PR leaked in this run. Parts A and C fully confirm read-only access works end-to-end on both surfaces. Part B could not exercise mcpg's own gateway-level write-blocking because gh-aw's References:
|
🤖 This is an automated PR from Repo Assist.
Implements the suggestion in #16661.
Changes
&on&strbindings (owner/repo/issue) intool_rules.rs,backend.rs,response_paths.rs(generated withcargo clippy --fix, reviewed).PolicyContextin thelabels/mod.rstest (fixesfield_reassign_with_default).No behaviour change; purely mechanical.
Test Status
cargo clippy --all-targets: 91 warnings → 0cargo test --lib: 724 passedrustfmt --checkonsrc/labels/*.rs: no diffswasm32-wasip1release build (target is not installed here); change only removes borrows.Closes #16661
Warning
Firewall blocked 4 domains
The following domains were blocked by the firewall during workflow execution:
example.comnonexistent.localslow.example.comthishostdoesnotexist12345.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run