chore: trait forward reference

This commit is contained in:
Shunsuke Shibayama 2023-10-19 00:55:18 +09:00
parent 06898bd793
commit 33f6bac20d
3 changed files with 144 additions and 135 deletions

View file

@ -34,6 +34,10 @@
_ -> panic "invalid semver string: \{s}"
@Override
__repr__ ref self = "SemVer(\{self.__str__()})"
compatible_with self, other =
if self.major == 0, do:
self.compatible_with::return self == other
self.major == other.major
#[
greater self, other: .Version =
match [self.major > other.major, self.major >= other.major, self.minor > other.minor, self.minor >= other.minor, self.patch > other.patch]: