Skip to main content

Module version

Module version 

Source
Expand description

NuGet version comparison, prerelease detection, and range/floating syntax.

§Why this is hand-rolled

No maintained Rust crate implements NuGet’s versioning scheme. NuGet versions are Major.Minor.Patch[.Revision] (1–4 numeric components, Major required) with SemVer2 prerelease precedence and case-insensitive prerelease label comparison; the workspace’s semver crate rejects both 1.2.3.4 (too many components) and 1.2 (too few) outright, so it cannot parse the common NuGet forms. deps-maven set the precedent for a crate-local hand-rolled comparator under the same constraint (no maintained crate for Maven’s scheme).

Functions§

compare_versions
Compares two NuGet version strings.
is_prerelease
Detects whether a NuGet version string is a prerelease version.
resolve_float
Resolves a floating-version pattern (*, 1.1.*, *-*, 1.2.0-rc.*, …) against a list of available versions, returning the highest matching version.
satisfies
Checks whether version satisfies a NuGet interval-notation range (spec §2).