Skip to main content

normalize_version_range

Function normalize_version_range 

Source
pub fn normalize_version_range(range: impl Into<String>) -> String
Expand description

Rewrites a hand-written version range into the syntax semver::VersionReq accepts. >= v1.19.0, < v1.19.6 -> >= 1.19.0, < 1.19.6 1.2.0 through 1.8.7 -> >= 1.2.0, <= 1.8.7 >= 2.1.0 < 2.2.7, >= 2.3.0 < 2.3.4 -> >= 2.1.0, < 2.2.7 || >= 2.3.0, < 2.3.4 < 1.8.4, < 1.9.1 -> >= 1.8.0, < 1.8.4 || >= 1.9.0, < 1.9.1 v1.18.0,v1.18.1 -> = 1.18.0 || = 1.18.1 All -> * >= 1.0.0, < 1.2.6 -> >= 1.0.0, < 1.2.6 (already valid: unchanged) NONE -> = NONE (still unparsable: the caller warns)