Skip to content
Finish up, move parse_meta to common.rs

We're almost done! Just some little cleanup things remain.

src/version.rs
--------------

Turns out our tests and the semver package we're writing this for expect
the function to be called `parse` rather than `parse_version`.  We'll
fix that now.

Also, it seems likely that the `parse_meta` function will be useful in the
range parsing module we will be making in the next step. Let's move that
to a new file, common.rs.

Now that `parse_meta` livse in another file, we will `use common` and
call it with `common::parse_meta`.

src/lib.rs
----------

Add in the (private) common module.  We don't need to add this to our
public interface.

src/common.rs
-------------

Let's make a couple changes to `parse_meta` while we're at it.  First,
we will change the argument name from `pre` to `s`, since it is used for
both prerelease and build tags.  We'll also split out the alphanumeric
check to a separate function.  Finally, we need to accept a plain number 0
as a Numeric, so a slight adjustment is needed on the regex here.