diff --git a/mesonbuild/cargo/version.py b/mesonbuild/cargo/version.py index cb09a004b..cde7a83a3 100644 --- a/mesonbuild/cargo/version.py +++ b/mesonbuild/cargo/version.py @@ -80,8 +80,7 @@ def convert(cargo_ver: str) -> T.List[str]: max_.append(str(int(v_) + 1)) bumped = True else: - if not (bumped and v_ == '0'): - min_.append(v_) + min_.append(v_) if not bumped: max_.append('0') diff --git a/unittests/cargotests.py b/unittests/cargotests.py index e1bce1c89..f0aedd0ca 100644 --- a/unittests/cargotests.py +++ b/unittests/cargotests.py @@ -39,8 +39,9 @@ class CargoVersionTest(unittest.TestCase): ('0.0', ['< 1']), ('0', ['< 1']), ('0.0.5', ['>= 0.0.5', '< 0.0.6']), - ('0.5.0', ['>= 0.5', '< 0.6']), + ('0.5.0', ['>= 0.5.0', '< 0.6']), ('0.5', ['>= 0.5', '< 0.6']), + ('1.0.45', ['>= 1.0.45', '< 2']), # Caret (Which is the same as unqualified) ('^2', ['>= 2', '< 3']), @@ -50,7 +51,7 @@ class CargoVersionTest(unittest.TestCase): ('^0.0', ['< 1']), ('^0', ['< 1']), ('^0.0.5', ['>= 0.0.5', '< 0.0.6']), - ('^0.5.0', ['>= 0.5', '< 0.6']), + ('^0.5.0', ['>= 0.5.0', '< 0.6']), ('^0.5', ['>= 0.5', '< 0.6']), # Multiple requirements