Skip to content

fix(guard): resolve all Rust clippy warnings#2874

Merged
lpcox merged 1 commit intomainfrom
fix/rust-clippy-warnings
Mar 30, 2026
Merged

fix(guard): resolve all Rust clippy warnings#2874
lpcox merged 1 commit intomainfrom
fix/rust-clippy-warnings

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented Mar 30, 2026

Fixes all 3 clippy warnings in the Rust guard:

  1. Needless lifetimes in extract_github_label_names — elided explicit lifetime annotations
  2. Unused import on MEDIUM_BUFFER_SIZE re-export — added #[allow(unused_imports)]
  3. Dead code on CollaboratorPermission.login — field is used in tests only, suppressed with #[cfg_attr(not(test), allow(dead_code))]

cargo clippy now produces zero warnings. All 248 tests pass.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

- 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>
Copilot AI review requested due to automatic review settings March 30, 2026 20:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_imports warning for the MEDIUM_BUFFER_SIZE re-export kept for backward compatibility.
  • Suppress dead_code for CollaboratorPermission.login in 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.

@lpcox lpcox merged commit 24fe309 into main Mar 30, 2026
14 checks passed
@lpcox lpcox deleted the fix/rust-clippy-warnings branch March 30, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants