From 716f44031a39c5e43fb441ecc470db76efc23dd4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 11:24:36 +0900 Subject: refactor(pcre): drop Result from Preg method return types The Preg methods panic on PCRE failure (per the file header rationale), so their anyhow::Result wrappers never carried an Err. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/plugin/plugin_manager.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/plugin') diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs index 24899cd..25953ab 100644 --- a/crates/shirabe/src/plugin/plugin_manager.rs +++ b/crates/shirabe/src/plugin/plugin_manager.rs @@ -257,7 +257,7 @@ impl PluginManager { } if package.get_name() == "symfony/flex" - && Preg::is_match3("{^[0-9.]+$}", &package.get_version(), None).unwrap_or(false) + && Preg::is_match3("{^[0-9.]+$}", &package.get_version(), None) && version_compare(&package.get_version(), "1.9.8", "<") { self.io.write_error(&format!("The \"{}\" plugin {}was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.", @@ -846,7 +846,7 @@ impl PluginManager { .map(|(k, v)| (k.clone(), *v)) .collect(); for (pattern, allow) in &rules_snapshot { - if Preg::is_match3(pattern, package, None).unwrap_or(false) { + if Preg::is_match3(pattern, package, None) { return Ok(*allow); } } -- cgit v1.3.1