diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-14 12:48:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-14 12:48:58 +0900 |
| commit | c1070afe69f53b621adea232527080d2c922e1a9 (patch) | |
| tree | be125ece467c2d1d761cd9f8a606337f6e5233f4 /crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs | |
| parent | 4ace644474d3d0e5575d19616ce46ba7d521fc64 (diff) | |
| download | php-shirabe-c1070afe69f53b621adea232527080d2c922e1a9.tar.gz php-shirabe-c1070afe69f53b621adea232527080d2c922e1a9.tar.zst php-shirabe-c1070afe69f53b621adea232527080d2c922e1a9.zip | |
refactor(pcre): consolidate duplicate preg_* shim helpers
The preg.rs shim had several near-duplicate functions: simple helpers
re-implementing logic already covered by their full-featured `2`
variants. Delegate or remove the redundant ones while preserving
behavior, and migrate the affected callers:
- preg_replace / preg_split now delegate to preg_replace2 / preg_split2
- preg_match_all_simple removed; its caller uses preg_match_all
- preg_split_chars removed; its caller uses a char-boundary iterator
- preg_match_offset removed; its callers use preg_match2 directly
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs index 27a74e6..0de90be 100644 --- a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs @@ -126,12 +126,10 @@ impl OutputFormatter { .expect("preg_replace failed"); style.set_href(&url); } else if r#match[0] == "options" { - let mut options: Vec<Vec<String>> = vec![]; - shirabe_php_shim::preg_match_all_simple( + let mut options = shirabe_php_shim::preg_match_all( "([^,;]+)", &shirabe_php_shim::strtolower(&r#match[1]), - &mut options, - )?; + ); let options = shirabe_php_shim::array_shift(&mut options).unwrap_or_default(); for option in &options { style.set_option(option); |
