Conversation
Remove three stale dead_code suppressions from functions that are actively called in production: - is_repo_private: called at 10 production sites across helpers.rs, response_items.rs, response_paths.rs, and tool_rules.rs - get_issue_author_association_with_callback: called by get_issue_author_association (which is itself a production-used wrapper) - get_issue_author_association: called at helpers.rs:1172 The remaining #[allow(dead_code)] on is_forked_pull_request_with_callback (line 221) is left intentionally — that function has zero production call sites and is test-only. Addresses #2369 (Improvement 1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
54 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cleans up stale Rust lint suppressions in rust-guard by removing #[allow(dead_code)] attributes from backend helpers that are now actively used, so the compiler can warn if they become unused again.
Changes:
- Removed
#[allow(dead_code)]fromis_repo_private. - Removed
#[allow(dead_code)]fromget_issue_author_association_with_callback. - Removed
#[allow(dead_code)]fromget_issue_author_association.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Fixes #2369 (Improvement 1).
Summary
Three
#[allow(dead_code)]attributes inguards/github-guard/rust-guard/src/labels/backend.rswere suppressing compiler warnings for functions that are actively used in production. These annotations were stale — the functions were wired up but the suppressions were never removed.Removed annotations
is_repo_privatehelpers.rs,response_items.rs,response_paths.rs,tool_rules.rsget_issue_author_association_with_callbackget_issue_author_association(below)get_issue_author_associationhelpers.rs:1172Retained annotation
The
#[allow(dead_code)]onis_forked_pull_request_with_callback(line 221) is intentionally kept — that function has zero production call sites and is exercised only by tests. It is dead code, and the annotation correctly signals that. Removing it is a separate, larger refactoring (Improvement 2 in #2369).Root cause
The annotations were added when these functions were first introduced (before they were wired up to callers) and never cleaned up.
Impact
Test Status
cargo checkruns clean in this environment:No warnings. The Rust build is fully validated locally. The CI pipeline will run the full test suite.