-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support introspection into a VersionReq #59
Comments
+1. I want to parse a semver and express the implied min/max constraints in a similar constraint syntax (Debian packaging metadata). It'd be real nice if |
It looks like semver-parser provides the ability to introspect into its version of VersionReq, but semver has its own version of VersionReq that doesn't allow introspection. Could semver just use the types from semver-parser, rather than converting to its own? |
I would say yes, but in a slightly different way: they should still convert over, but we should evolve Now that we've fully converted over, I want to take a hard look at the whole interface, looking towards a 1.0. These kinds of changes are the things I might want to make. |
@steveklabnik Why the separate types and conversion between them? |
They're two separate crates, the conversion means that I don't leak the specific semver-parser into semver's external API. |
Is there a strong reason to keep them separate rather than unifying them? |
I like small crates, and keeping concerns separate. One crate for one thing; one handles the conversions, the other has all of the logic for comparisons, etc. it feels like the split between -sys and not to me. Plus, there could be other back ends: maybe that nom parser I tried would work better, or LALRPOP. But! Part of that is the beauty of < 1.0: I'm not actually sure. We'll see. On Aug 8, 2016, 19:23 -0400, Josh Triplett notifications@github.com, wrote:
|
I don't know how it could be implemented: for now |
This is now available in 1.0.0. https://docs.rs/semver/1.0.0-rc.1/semver/struct.VersionReq.html |
It'd be nice to be able to look directly at the set of constraints in a
VersionReq
. For example, the implementation of RFC 1241 wants to check if aVersionReq
corresponds to a wildcard but the implementation is forced to just compare for equality agaistVersionReq::parse("*").unwrap()
: https://github.com/rust-lang/cargo/pull/2005/files#diff-e23c793746a7be78139a4e37509a74acR112The text was updated successfully, but these errors were encountered: