summaryrefslogtreecommitdiffstats
path: root/src/pkgver
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkgver')
-rw-r--r--src/pkgver/mod.rs24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/pkgver/mod.rs b/src/pkgver/mod.rs
index 5abb5c0..876f436 100644
--- a/src/pkgver/mod.rs
+++ b/src/pkgver/mod.rs
@@ -21,10 +21,7 @@ fn split_full_version(v: &str) -> (String, String, String) {
}
}
-/// The real definition. The module is private, so this `pub`
-/// is not a nameable path from outside; the alias below is the
-/// only way to reach it, and the alias is what carries the
-/// feature-conditional visibility.
+/// The real definition; the alias below carries the feature-conditional visibility.
mod version {
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Version {
@@ -34,11 +31,8 @@ mod version {
}
}
-/// a parsed epoch-ver-rel. Every caller uses the value `parse` hands back without naming the type; the tests that pin the ordering do name it.
-///
-/// `pub` only under `test-support`. Production reaches the type
-/// through its own module and never names it from outside; the
-/// outside reader that needs the name is a test.
+/// A parsed epoch-ver-rel. Only tests name the type; production uses the value
+/// `parse` hands back.
#[cfg(feature = "test-support")]
pub use version::Version;
@@ -186,8 +180,6 @@ pub fn is_downgrade(current: &str, new: &str) -> bool {
vercmp(current, new) == Ordering::Greater
}
-// ------------------------------------------------------------- dep strings --
-
#[derive(Debug, Clone, PartialEq, Eq)]
enum DepOp {
Any,
@@ -240,8 +232,7 @@ impl Dep {
Some(Dep { name: s.trim().to_string(), op: DepOp::Any, version: None })
}
- /// Only the tests inside this module ask for a `Dep`'s name; production
- /// reads the field. Gated so the release build does not compile it.
+ /// Asked for only by this module's tests; production reads the field.
#[cfg(test)]
fn name(&self) -> &str {
&self.name
@@ -335,13 +326,6 @@ mod tests {
assert!(Dep::parse("foo").unwrap().satisfied_by("anything"));
}
- // ---------------------------------------------------------------------
- // Moved verbatim from tests/versions.rs: every test here is a function of
- // its arguments alone — no database, no fixture, no temporary directory —
- // which is what makes it a unit test of this module rather than a consumer
- // of it.
- // ---------------------------------------------------------------------
-
const ORDERED: &[(&str, &str)] = &[
("v1.2.3", "v1.2.4"),
("1.0", "1.1"),