Skip to content
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

Deprecate WildcardVersion::Major? #150

Closed
udoprog opened this issue Nov 6, 2017 · 5 comments
Closed

Deprecate WildcardVersion::Major? #150

udoprog opened this issue Nov 6, 2017 · 5 comments

Comments

@udoprog
Copy link
Contributor

udoprog commented Nov 6, 2017

Hey,

I'm currently trying to do a comparison for when a VersionReq is a full wildcard: *.

For all intents and purposes, the following states of VersionReq appears to be equivalent:

  • predicates is empty, causing the all check to return true.
  • there is one predicate, whose op is Op::Wildcard(WildcardVersion::Major).

Both of these cases appears to match any version. Both of them are fmt::Display:ed in a way so that they show *.

I would like to discuss if we could either have VersionReq::any() return the same as when * is parsed (single WildcardVersion::Major predicate) to make comparisons viable. Or to completely deprecate the use of WilcardVersion::Major since its functionality is equivalent to an empty set of predicates.

@steveklabnik
Copy link
Contributor

This is a good question! I'm not sure.

@udoprog
Copy link
Contributor Author

udoprog commented Nov 6, 2017

For my specific problem, introducing a function like is_wildcard would also work:
https://github.com/udoprog/semver/commit/c27a8c9ebf1b3393f500cab05a5d5bd9c36b437b

@steveklabnik
Copy link
Contributor

I've accepted the underlying PR in semver-parser, so we can do this here too.

@udoprog
Copy link
Contributor Author

udoprog commented Nov 24, 2017

I've rebased #151. When version 0.8.0 of semver-parser is available it is good to go.
I've also closed #159 since you'll be taking this approach.

Thanks!

@dtolnay
Copy link
Owner

dtolnay commented May 25, 2021

This is fixed in 1.0.0. The * requirement is now uniformly represented with an empty comparator set, and there is no WildcardVersion::Major.

@dtolnay dtolnay closed this as completed May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants