Skip to content

Add VersionReq::is_exact - #205

Merged
steveklabnik merged 1 commit into
dtolnay:masterfrom
illicitonion:is_exact
May 24, 2020
Merged

steveklabnik merged 1 commit into
dtolnay:masterfrom
illicitonion:is_exact

Conversation

@illicitonion

Copy link
Copy Markdown
Contributor

I have some logic where it would be useful to shortcut some behaviour if
a VersionReq could only be matched by exactly one value. This would
help me not end up re-parsing the semver string myself to guess whether
it's a single fully-qualified exact match.

I have some logic where it would be useful to shortcut some behaviour if
a `VersionReq` could only be matched by exactly one value. This would
help me not end up re-parsing the semver string myself to guess whether
it's a single fully-qualified exact match.

@steveklabnik steveklabnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! So sorry that I blocked your Cargo contribution here, I didn't realize!

I am happy to merge this, but getting it into a release may take some work. I am not sure if master is in a releasable state or not. I will try to figure that out ASAP!

@steveklabnik
steveklabnik merged commit 681ed12 into dtolnay:master May 24, 2020
@illicitonion

Copy link
Copy Markdown
Contributor Author

Thanks for the merge! No rush with the releasing - we're using a workaround in Cargo for now (inferring this property from the string representation of a VersionReq), but it would be nice to clean that up to use the more precise check whenever it's convenient :)

Thanks again!

@illicitonion
illicitonion deleted the is_exact branch May 25, 2020 00:03
@steveklabnik

Copy link
Copy Markdown
Contributor

Great!

I've published as 0.10.0; the breaking change wasn't actually merged yet, so this should be fine! This is the only new API in the new release.

takumi-earth pushed a commit to earthlings-dev/semver that referenced this pull request Jan 27, 2026
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

Successfully merging this pull request may close these issues.

2 participants