From 614616d4ceeb78dcf22df3e36a0fceb4c2d110c8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 13:12:06 +0900 Subject: refactor(pcre): return bool/usize from preg_*2 shim helpers preg_match2 returns bool and the preg_match_all* helpers return usize (the match count is never negative), matching how callers use them. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/input/string_input.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console') diff --git a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs index f57fcf6..03aaa64 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs @@ -55,9 +55,7 @@ impl StringInput { } let mut m: IndexMap> = IndexMap::new(); - if shirabe_php_shim::preg_match2(r"/\s+/A", input, Some(&mut m), 0, cursor as usize) - == 1 - { + if shirabe_php_shim::preg_match2(r"/\s+/A", input, Some(&mut m), 0, cursor as usize) { if token.is_some() { tokens.push(token.take().unwrap()); } @@ -69,8 +67,7 @@ impl StringInput { Some(&mut m), 0, cursor as usize, - ) == 1 - { + ) { let inner = shirabe_php_shim::substr( m[&CaptureKey::ByIndex(3)].as_deref().unwrap_or(""), 1, @@ -93,8 +90,7 @@ impl StringInput { Some(&mut m), 0, cursor as usize, - ) == 1 - { + ) { token = Some(format!( "{}{}", token.unwrap_or_default(), @@ -112,8 +108,7 @@ impl StringInput { Some(&mut m), 0, cursor as usize, - ) == 1 - { + ) { token = Some(format!( "{}{}", token.unwrap_or_default(), -- cgit v1.3.1