Skip to content
Implement `version::parse`

The `version::parse` function takes a semver version string as input and
returns a `Result` containing either a `Version` struct or an error
string.

The `Version` struct contains a field for each possible component of a
semver version string.  The `major`, `minor`, and `patch` fields are all
required integers.  The `pre` and `build` fields consist of zero or more
alphanumeric or numeric identifiers.

This is a bit too much code to explain at once, so click the `+` symbol
on the left for a step-by-step explanation.  Once you're done, click the
arrow at the top right to continue on to the range parsing function.

*What about that test suite you mentioned?*

There are a lot of tests! To keep things clean, we'll show them all in
the final step of the tutorial.