MCPcopy Create free account
hub / github.com/apache/fory / _normalize_rust_version

Function _normalize_rust_version

ci/release.py:1020–1036  ·  view source on GitHub ↗
(v: str)

Source from the content-addressed store, hash-verified

1018
1019
1020def _normalize_rust_version(v: str) -> str:
1021 v = v.strip()
1022 v = re.sub(r"-(alpha|beta|rc)(\d+)$", r"-\1.\2", v)
1023 if re.search(r"(?i)-(alpha|beta)\.0$", v):
1024 return v
1025 if re.search(r"(?i)-(alpha|beta|rc)\.\d+$", v):
1026 return v
1027 if re.search(r"(?i)-pre$", v):
1028 return v
1029 dev_match = re.search(r"(?i)(?:-dev|\\.dev)(\\d+)$", v)
1030 if dev_match:
1031 base = re.sub(r"(?i)(?:-dev|\\.dev)\\d+$", "", v)
1032 return f"{base}-alpha.{dev_match.group(1)}"
1033 if re.search(r"(?i)(-snapshot|\\.dev|-dev)$", v):
1034 base = re.sub(r"(?i)(-snapshot|\\.dev|-dev)$", "", v)
1035 return f"{base}-alpha.0"
1036 return v
1037
1038
1039def _parse_args():

Callers 1

bump_rust_versionFunction · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected