Skip to content

Commit e6787f5

Browse files
authored
fix: mark ORDER_HIGH_TO_LOW as test-only to fix dead_code error (#5675)
The Rust guard constant `ORDER_HIGH_TO_LOW` is only used in the test module but was declared unconditionally, causing a `dead_code` error with `-D warnings` in release builds (CI docker job failure). Fix: annotate with `#[cfg(test)]` so it's only compiled in test builds. Fixes the docker job failure in: https://github.com/github/gh-aw-mcpg/actions/runs/25843873997/job/75935158560
2 parents 0c41c6d + 8211207 commit e6787f5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

guards/github-guard/rust-guard/src/labels/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub mod policy_integrity {
2828
pub const APPROVED: &str = "approved";
2929
pub const MERGED: &str = "merged";
3030

31+
#[cfg(test)]
3132
pub const ORDER_HIGH_TO_LOW: [&str; 4] = [MERGED, APPROVED, UNAPPROVED, NONE];
3233
/// Low-to-high order joined with `|`, ready for use in error messages.
3334
pub const ORDER_LOW_TO_HIGH_PIPED: &str = "none|unapproved|approved|merged";

0 commit comments

Comments
 (0)