fix(guard): resolve all Rust clippy warnings#2874
Merged
Conversation
- Remove needless lifetime annotations in extract_github_label_names - Suppress unused import warning on MEDIUM_BUFFER_SIZE re-export - Suppress dead_code warning on CollaboratorPermission.login (test-only) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes/suppresses the remaining Rust/clippy warnings in the GitHub Rust guard crate, keeping the public API and test-only fields intact while ensuring cargo clippy is clean.
Changes:
- Elide an unnecessary explicit lifetime in
extract_github_label_names. - Suppress an
unused_importswarning for theMEDIUM_BUFFER_SIZEre-export kept for backward compatibility. - Suppress
dead_codeforCollaboratorPermission.loginin non-test builds while retaining test usage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/mod.rs |
Adds a targeted lint allow for a backward-compat public re-export. |
guards/github-guard/rust-guard/src/labels/helpers.rs |
Simplifies a helper signature by removing a needless explicit lifetime. |
guards/github-guard/rust-guard/src/labels/backend.rs |
Suppresses dead_code for a field used only by tests, without changing runtime behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 30, 2026
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.
Fixes all 3 clippy warnings in the Rust guard:
extract_github_label_names— elided explicit lifetime annotationsMEDIUM_BUFFER_SIZEre-export — added#[allow(unused_imports)]CollaboratorPermission.login— field is used in tests only, suppressed with#[cfg_attr(not(test), allow(dead_code))]cargo clippynow produces zero warnings. All 248 tests pass.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com