From 78157ab3ffeca37023381a422fccda2d4a0c64af Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 04:01:45 +0900 Subject: refactor(pcre): drop strict-groups Preg variants Rust's type system already distinguishes participating from non-participating capture groups via Option, so the *StrictGroups methods add no safety here. Remove them and switch callers to the plain variants. --- crates/shirabe/src/platform/version.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 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 e602f15..f1d2b87 100644 --- a/crates/shirabe/src/platform/version.rs +++ b/crates/shirabe/src/platform/version.rs @@ -11,11 +11,9 @@ impl Version { *is_fips = false; let mut matches: IndexMap = IndexMap::new(); - if !Preg::match_strict_groups3( - r"^(?P[0-9.]+)(?P[a-z]{0,2})(?P(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)(?:-\w+)?(?: \(.+?\))?$", - openssl_version, - Some(&mut matches), - ) + if !Preg::match3(r"^(?P[0-9.]+)(?P[a-z]{0,2})(?P(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)(?:-\w+)?(?: \(.+?\))?$", + openssl_version, + Some(&mut matches),) .unwrap_or(false) { return None; @@ -57,7 +55,7 @@ impl Version { pub fn parse_libjpeg(libjpeg_version: &str) -> Option { let mut matches: IndexMap = IndexMap::new(); - if !Preg::match_strict_groups3( + if !Preg::match3( r"^(?P\d+)(?P[a-z]*)$", libjpeg_version, Some(&mut matches), @@ -84,7 +82,7 @@ impl Version { pub fn parse_zoneinfo_version(zoneinfo_version: &str) -> Option { let mut matches: IndexMap = IndexMap::new(); - if !Preg::match_strict_groups3( + if !Preg::match3( r"^(?P\d{4})(?P[a-z]*)$", zoneinfo_version, Some(&mut matches), -- cgit v1.3.1