diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 19:06:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 19:07:15 +0900 |
| commit | b6604e1395f003748fe40a44e1190470632a40ce (patch) | |
| tree | 27ce3c137c860a7bd8914852ba5f851e213d448c /crates/shirabe-symfony-console/src/terminal.rs | |
| parent | c5605cc072c1880af7d70647278c6aa0de43f402 (diff) | |
| download | php-shirabe-b6604e1395f003748fe40a44e1190470632a40ce.tar.gz php-shirabe-b6604e1395f003748fe40a44e1190470632a40ce.tar.zst php-shirabe-b6604e1395f003748fe40a44e1190470632a40ce.zip | |
refactor(preg): import preg_*() instead of qualifying them
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-symfony-console/src/terminal.rs')
| -rw-r--r-- | crates/shirabe-symfony-console/src/terminal.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/shirabe-symfony-console/src/terminal.rs b/crates/shirabe-symfony-console/src/terminal.rs index 9af712ad..8ff0431a 100644 --- a/crates/shirabe-symfony-console/src/terminal.rs +++ b/crates/shirabe-symfony-console/src/terminal.rs @@ -1,6 +1,6 @@ //! ref: composer/vendor/symfony/console/Terminal.php -use shirabe_php_shim::{PhpMixed, php_regex}; +use shirabe_php_shim::{PhpMixed, php_regex, preg_match}; use std::cell::Cell; thread_local! { @@ -81,7 +81,7 @@ impl Terminal { let ansicon = shirabe_php_shim::getenv("ANSICON"); let mut matches: Vec<Option<String>> = Vec::new(); if let Some(ansicon) = &ansicon - && shirabe_php_shim::preg_match( + && preg_match( php_regex!("/^(\\d+)x(\\d+)(?: \\((\\d+)x(\\d+)\\))?$/"), &shirabe_php_shim::trim(&ansicon.to_string_lossy(), None), &mut matches, @@ -138,7 +138,7 @@ impl Terminal { return; } let mut matches: Vec<Option<String>> = Vec::new(); - if shirabe_php_shim::preg_match( + if preg_match( php_regex!("/rows.(\\d+);.columns.(\\d+);/i"), &stty_string, &mut matches, @@ -154,7 +154,7 @@ impl Terminal { matches[1].clone().unwrap_or_default(), )))) }); - } else if shirabe_php_shim::preg_match( + } else if preg_match( php_regex!("/;.(\\d+).rows;.(\\d+).columns/i"), &stty_string, &mut matches, @@ -182,7 +182,7 @@ impl Terminal { let info = info?; let mut matches: Vec<Option<String>> = Vec::new(); - if !shirabe_php_shim::preg_match( + if !preg_match( php_regex!("/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/"), &info, &mut matches, |
