-
Notifications
You must be signed in to change notification settings - Fork 31
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
Is the bump method on the Version trait actually necessary? #49
Comments
well maybe not that since it's not |
Is it worth thinking even more meta, can we take a |
Indeed. I'm not 100% sure, but I believe the |
Skimming through the code, The |
For example: So Given that kind of tricky corner case I am not seeing a way to support |
This question is now obsolete since we merged in dev the bounded range design where each bound of the range can be inclusive or exclusive. We only need the order and can avoid the bump and lowest methods. |
The ability to know the next version, expressed by the
bump(&self) -> Self
method on theVersion
trait does not seem to be vital. In the code, it is only used twice. The first time is for the definition ofRange::exact(Version) -> Range
. The second time is in the implementation ofDisplay
for an exact range, in order to have more readable reports. There, it is used to check if we have a range like(v1, Some(v2))
wherev2 == v1.bump()
. In such case it would be displayedv1
instead ofv1 <= v < v2
.In addition, requiring a
bump
method seems like something that will prevent usage of things like pre-releases or versions based on dates, floating point numbers or other potentially valid versions otherwise.If we were to remove the
bump
method, how could be represent ranges containing a single version that would still play nice with set operations like intersection and union?The text was updated successfully, but these errors were encountered: