From cfd2a4488797ddaabd0087aa0021b26892663ffb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 13:02:59 +0900 Subject: refactor(pcre): treat regex compile failure as fatal in shim The preg_* shim helpers wrapped their results in Option/Result solely to signal a regex that failed to compile. Composer never feeds a pattern that fails at runtime, so such a failure is a programming error: panic instead and drop the Option/Result wrappers, updating all callers. preg_replace_callback keeps its Result return type since the callback itself is fallible. preg_match_groups is removed in favor of preg_match at its sole call site. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../shirabe-external-packages/src/symfony/console/input/input_option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/input/input_option.rs') diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs index 7e2d086..5ef265e 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs @@ -110,7 +110,7 @@ impl InputOption { fn normalize_shortcut(s: String) -> anyhow::Result> { let stripped = shirabe_php_shim::ltrim(&s, Some("-")); - let parts = shirabe_php_shim::preg_split(r"\|(-?)", &stripped).unwrap_or_default(); + let parts = shirabe_php_shim::preg_split(r"\|(-?)", &stripped); let filtered: Vec = shirabe_php_shim::array_filter(&parts, |s: &String| !s.is_empty()); let result = shirabe_php_shim::implode("|", &filtered); -- cgit v1.3.1