diff options
Diffstat (limited to 'crates/shirabe-symfony-console/src/helper')
| -rw-r--r-- | crates/shirabe-symfony-console/src/helper/helper.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe-symfony-console/src/helper/helper.rs b/crates/shirabe-symfony-console/src/helper/helper.rs index 21f20d34..435648ca 100644 --- a/crates/shirabe-symfony-console/src/helper/helper.rs +++ b/crates/shirabe-symfony-console/src/helper/helper.rs @@ -40,7 +40,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 preg_match(php_regex!("//u"), string, &mut Vec::new()) { + if preg_match(php_regex!("//u"), string).is_some() { return UnicodeString::new(string).width(false); } @@ -56,7 +56,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 preg_match(php_regex!("//u"), string, &mut Vec::new()) { + if preg_match(php_regex!("//u"), string).is_some() { return UnicodeString::new(string).length(); } |
