Open stanislav-tkach opened 3 years ago
It is definitely useful to be able to parse a version to extract major/minor (maybe only to feed to legacy APIs).
But different OS have different conventions (think FreeBSD's 13.2-RELEASE
).
The constraint would be, how we can go on providing an API to easily extract major/minor if any. Maybe a Version::get_major_minor()
method, with a match statement on os type to delegate to various version parsers?
@ydirson I really like your idea. Perhaps it would be the best middle ground: to store version as a string and have a bunch of methods to (try to) extract more specific information.
Perhaps representing a version with the enum was a mistake. Now I think that
Option<String>
is enough. I'm not sure if it is worth one more breaking change (4.0?), though.