From d7c686f6c488739fc9d061bb0f89d73e6445fade Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 13:08:21 +0900 Subject: refactor(pcre): return bool from preg_match shim preg_match can only return 1 or 0 now that compile failure panics, so return bool and update all call sites accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-external-packages/src/symfony/console/helper/helper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/helper') diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/helper.rs b/crates/shirabe-external-packages/src/symfony/console/helper/helper.rs index 07b1f77..cc49f0a 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/helper.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/helper.rs @@ -38,7 +38,7 @@ impl Helper { /// Returns the width of a string, using mb_strwidth if it is available. /// The width is how many characters positions the string will use. pub fn width(string: &str) -> i64 { - if shirabe_php_shim::preg_match("//u", string, &mut Vec::new()) != 0 { + if shirabe_php_shim::preg_match("//u", string, &mut Vec::new()) { return UnicodeString::new(string).width(false); } @@ -54,7 +54,7 @@ impl Helper { /// Returns the length of a string, using mb_strlen if it is available. /// The length is related to how many bytes the string will use. pub fn length(string: &str) -> i64 { - if shirabe_php_shim::preg_match("//u", string, &mut Vec::new()) != 0 { + if shirabe_php_shim::preg_match("//u", string, &mut Vec::new()) { return UnicodeString::new(string).length(); } -- cgit v1.3.1