Skip to main content

parse_lenient

Function parse_lenient 

Source
pub fn parse_lenient(raw: &str) -> Result<VersionReq, Error>
Expand description

Parse raw as a SemVer requirement, accepting either comma- or space-separated comparator lists. Bare operators (>= 1.2) are rejoined with their version. Returns the original parse error when the input cannot be coerced into either form so callers’ diagnostics keep pointing at the user’s text.

§Errors

Returns the semver::Error from parsing raw when it parses neither directly nor after normalization into a comma-separated comparator list.