From a1c7e6908a26e10f6e1f23a51721664b5e2d838d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 02:53:53 +0900 Subject: chore(style): cargo fmt --- crates/shirabe/src/platform/version.rs | 35 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'crates/shirabe/src/platform/version.rs') 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 { - let matches = Preg::match_strict_groups( - r"^(?P\d+)(?P[a-z]*)$", - libjpeg_version, - )?; + let matches = + Preg::match_strict_groups(r"^(?P\d+)(?P[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 { - let matches = Preg::match_strict_groups( - r"^(?P\d{4})(?P[a-z]*)$", - zoneinfo_version, - )?; + let matches = + Preg::match_strict_groups(r"^(?P\d{4})(?P[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 { -- cgit v1.3.1