aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/helper
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-14 13:08:21 +0900
committernsfisis <nsfisis@gmail.com>2026-06-14 13:08:21 +0900
commitd7c686f6c488739fc9d061bb0f89d73e6445fade (patch)
treee3b694c9e96486a13032e63e616a1ed920edd90a /crates/shirabe-external-packages/src/symfony/console/helper
parentcfd2a4488797ddaabd0087aa0021b26892663ffb (diff)
downloadphp-shirabe-d7c686f6c488739fc9d061bb0f89d73e6445fade.tar.gz
php-shirabe-d7c686f6c488739fc9d061bb0f89d73e6445fade.tar.zst
php-shirabe-d7c686f6c488739fc9d061bb0f89d73e6445fade.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/helper')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/helper/helper.rs4
1 files changed, 2 insertions, 2 deletions
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();
}