Skip to main content

validate_version_format

Function validate_version_format 

Source
pub fn validate_version_format(version: &str) -> Result<(), PackageError>
Expand description

Validate a single [package] version string.

Accepts MAJOR.MINOR.PATCH with an optional pre-release (-x.y) and/or build metadata (+abc), matching the common semver shape. Rejects empty strings, missing components, non-numeric components, and negative numbers.