-
Notifications
You must be signed in to change notification settings - Fork 6
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 major/minor/micro for Version #9
Conversation
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.
Could you please change those to getters and @property
as packaging does?
src/version.rs
Outdated
#[getter] | ||
pub fn major(&self) -> usize { | ||
self.0.major | ||
} | ||
/// The second item of release or 0 if unavailable. | ||
#[getter] | ||
pub fn minor(&self) -> usize { | ||
self.0.minor | ||
} | ||
/// The third item of release or 0 if unavailable. | ||
#[getter] | ||
pub fn micro(&self) -> usize { | ||
self.0.micro | ||
} |
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.
Do you mean this?
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.
yeah, but don't make them fields of the object (they are duplicate with the release vec), but get them dynamically from the vec
thank you! |
Like
packaging
: https://packaging.pypa.io/en/stable/version.html#packaging.version.Version.major, addmajor
/minor
/micro
property.