-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add matches_prerelease
to allow update to prerelease version if it meets Semver compatible
#321
Changes from 1 commit
174ec3f
074c7c3
2b5a7d3
d43191a
7b4ad61
3464fd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I got everything right, these are the current-proposed semantic In both matches and matches_prerelease columns the equivalent matching semantic is using the old
table markdown source
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @linyihai Please help correct if anything wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The two are different, even if they are same literally In the Lines 14 to 21 in 69efd3c
For example, see playground example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yean I forgot that part. It's the old matches minus prerelease speicial treatment, right? diff --git a/src/eval.rs b/src/eval.rs
index e6e3894..6cdf99d 100644
--- a/src/eval.rs
+++ b/src/eval.rs
@@ -7,20 +7,7 @@ pub(crate) fn matches_req(req: &VersionReq, ver: &Version) -> bool {
}
}
- if ver.pre.is_empty() {
- return true;
- }
-
- // If a version has a prerelease tag (for example, 1.2.3-alpha.3) then it
- // will only be allowed to satisfy req if at least one comparator with the
- // same major.minor.patch also has a prerelease tag.
- for cmp in &req.comparators {
- if pre_is_compatible(cmp, ver) {
- return true;
- }
- }
-
- false
+ true
}
pub(crate) fn matches_comparator(cmp: &Comparator, ver: &Version) -> bool { There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It equivalents what you said, but I add a flag to sidestep that
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra newline