aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/version/version_parser.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-19 00:10:22 +0900
committernsfisis <nsfisis@gmail.com>2026-05-19 00:11:03 +0900
commitc839244d8d09f3036ebfee8eef7eb6b147e593ab (patch)
treefe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/package/version/version_parser.rs
parent48839250146b217e2756ed3c0e624fd341b54d6c (diff)
downloadphp-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/version/version_parser.rs')
-rw-r--r--crates/shirabe/src/package/version/version_parser.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/shirabe/src/package/version/version_parser.rs b/crates/shirabe/src/package/version/version_parser.rs
index 6bb1004..6dbf425 100644
--- a/crates/shirabe/src/package/version/version_parser.rs
+++ b/crates/shirabe/src/package/version/version_parser.rs
@@ -74,6 +74,28 @@ impl VersionParser {
Ok(result)
}
+ pub fn new() -> Self {
+ Self {
+ inner: SemverVersionParser,
+ }
+ }
+
+ pub fn normalize(&self, version: &str, full_version: Option<&str>) -> anyhow::Result<String> {
+ self.inner.normalize(version, full_version)
+ }
+
+ pub fn normalize_stability(stability: &str) -> anyhow::Result<String> {
+ SemverVersionParser::normalize_stability(stability)
+ }
+
+ pub fn normalize_branch(&self, name: &str) -> anyhow::Result<String> {
+ self.inner.normalize_branch(name)
+ }
+
+ pub fn parse_stability(version: &str) -> String {
+ SemverVersionParser::parse_stability(version)
+ }
+
pub fn is_upgrade(normalized_from: &str, normalized_to: &str) -> anyhow::Result<bool> {
if normalized_from == normalized_to {
return Ok(true);