Checking a semver restriction is greater than or equal to another semver restriction

Viewed 34

I want to enforce a dependency's version requirement in a cargo toml is greater than or equal to another restriction. In a way I want ordering operator between a semver::VersionReq and a semver::Comparator. Aka can the right hand side hold under the conditions of the left hand side.

For example 0.5 >= 0.4, 0.5.1 >= 0.4, * >= 100.100.100 etc. I was looking to implement this myself but got a bit scared of from the number of the possible combinations on semver::Op. I couldn't find any of this logic in the semver crate, is there any other crates that can do this?

Maybe there a simpler way to do this using the cargo resolver?

0 Answers
Related