diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
| commit | a1c7e6908a26e10f6e1f23a51721664b5e2d838d (patch) | |
| tree | c575c76f1b43359ed74913da4c6a2636643f1ba0 /crates/shirabe/src/platform/version.rs | |
| parent | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (diff) | |
| download | php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.gz php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.zst php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.zip | |
chore(style): cargo fmt
Diffstat (limited to 'crates/shirabe/src/platform/version.rs')
| -rw-r--r-- | crates/shirabe/src/platform/version.rs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/crates/shirabe/src/platform/version.rs b/crates/shirabe/src/platform/version.rs index 5c64098..a9566ee 100644 --- a/crates/shirabe/src/platform/version.rs +++ b/crates/shirabe/src/platform/version.rs @@ -15,7 +15,10 @@ impl Version { )?; let patch = if version_compare(&matches["version"], "3.0.0", "<") { - format!(".{}", Self::convert_alpha_version_to_int_version(&matches["patch"])) + format!( + ".{}", + Self::convert_alpha_version_to_int_version(&matches["patch"]) + ) } else { String::new() }; @@ -25,25 +28,33 @@ impl Version { .replace("-fips", "") .replace("-pre", "-alpha"); - Some(format!("{}{}{}", matches["version"], patch, suffix).trim_end_matches('-').to_string()) + Some( + format!("{}{}{}", matches["version"], patch, suffix) + .trim_end_matches('-') + .to_string(), + ) } pub fn parse_libjpeg(libjpeg_version: &str) -> Option<String> { - let matches = Preg::match_strict_groups( - r"^(?P<major>\d+)(?P<minor>[a-z]*)$", - libjpeg_version, - )?; + let matches = + Preg::match_strict_groups(r"^(?P<major>\d+)(?P<minor>[a-z]*)$", libjpeg_version)?; - Some(format!("{}.{}", matches["major"], Self::convert_alpha_version_to_int_version(&matches["minor"]))) + Some(format!( + "{}.{}", + matches["major"], + Self::convert_alpha_version_to_int_version(&matches["minor"]) + )) } pub fn parse_zoneinfo_version(zoneinfo_version: &str) -> Option<String> { - let matches = Preg::match_strict_groups( - r"^(?P<year>\d{4})(?P<revision>[a-z]*)$", - zoneinfo_version, - )?; + let matches = + Preg::match_strict_groups(r"^(?P<year>\d{4})(?P<revision>[a-z]*)$", zoneinfo_version)?; - Some(format!("{}.{}", matches["year"], Self::convert_alpha_version_to_int_version(&matches["revision"]))) + Some(format!( + "{}.{}", + matches["year"], + Self::convert_alpha_version_to_int_version(&matches["revision"]) + )) } fn convert_alpha_version_to_int_version(alpha: &str) -> i64 { |
