Skip to content
Add enums and structs for range parsing

Let's define all the nifty types we'll need!

src/range.rs
------------

We've described some of these back in the introduction to range parsing,
but a little more won't hurt.

`VersionReq` contains one or more predicates.  This is what we need to
supply to the semver crate.

`Predicate` is similar to the `Version` struct we used in the version
parsing module, but the types are slightly different. We have added the
Op field and the minor and patch versions are now optional.

`Op` stands for operator.  The operator defines how to match a specific
version to this predicate.

`WildcardVersion` is used for the `Wildcard` operator.  There might be a
wildcard at the major, minor, or patch version.  Since they are numeric
types, we don't assign `Wildcard` to the field directly, instead we
list it as the operator.

We'll also pull in `version::Identifier`, for use with the prerelease
strings.  I wonder if that should have been `common::Identifier`. Hmm.