Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #187 +/- ##
==========================================
+ Coverage 85.82% 85.86% +0.04%
==========================================
Files 15 15
Lines 6313 6331 +18
==========================================
+ Hits 5418 5436 +18
Misses 895 895 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I ran the failing checks and found the cause: the test threat_level_as_hash_key referenced ThreatLevel without importing it. The test module's existing use super::*; is behind #[cfg(any(feature = "client", feature = "server"))], so when running the default cargo test / cargo clippy --tests (no features enabled) ThreatLevel ended up undeclared. I fixed this by adding use super::ThreatLevel; directly in the test function, committed the change, and pushed it. Tests now pass and the CI checks that were blocking this PR are resolved. Summary: added an explicit import for ThreatLevel in the failing test, pushed the fix, and CI is green. |
Summary
This change adds a Hash derive for the ThreatLevel enum so it can be used directly as a HashMap key. This makes it easier for downstream crates (for example review-database) to count or group items by threat level without introducing local workarounds.
What I changed
Why
Consumers of review-protocol want to use ThreatLevel in hash-based collections (e.g., HashMap) to count or aggregate events by threat level. Deriving Hash is a small, backward-compatible change that enables that usage pattern.
Notes
Closes #186