summaryrefslogtreecommitdiffstats
path: root/src/review
diff options
context:
space:
mode:
Diffstat (limited to 'src/review')
-rw-r--r--src/review/risk.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/review/risk.rs b/src/review/risk.rs
index 9a7145d..e48ca24 100644
--- a/src/review/risk.rs
+++ b/src/review/risk.rs
@@ -3,7 +3,18 @@ use crate::error::Result;
use crate::pkgver;
pub mod level {
- pub const LOW: &str = "low";
+ /// `MEDIUM` and `HIGH` are matched by the UI to order risk, so they are
+ /// genuinely public. `LOW` is only ever produced here and asserted by a
+ /// test, so it is crate-internal in a production build. The string lives
+ /// once, in `LOW_VALUE`, so the two aliases cannot drift.
+ const LOW_VALUE: &str = "low";
+
+ #[cfg(feature = "test-support")]
+ pub const LOW: &str = LOW_VALUE;
+
+ #[cfg(not(feature = "test-support"))]
+ pub(crate) const LOW: &str = LOW_VALUE;
+
pub const MEDIUM: &str = "medium";
pub const HIGH: &str = "high";
}