diff options
Diffstat (limited to 'crates/shirabe/src/console')
| -rw-r--r-- | crates/shirabe/src/console/html_output_formatter.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/crates/shirabe/src/console/html_output_formatter.rs b/crates/shirabe/src/console/html_output_formatter.rs index 3b4018e3..4a5583fb 100644 --- a/crates/shirabe/src/console/html_output_formatter.rs +++ b/crates/shirabe/src/console/html_output_formatter.rs @@ -1,7 +1,7 @@ //! ref: composer/src/Composer/Console/HtmlOutputFormatter.php use indexmap::IndexMap; -use shirabe_pcre::{CaptureKey, Preg, PregMatchedGroups}; +use shirabe_pcre::{CaptureKey, Preg, PregMatches}; use shirabe_symfony_console::formatter::OutputFormatter; use shirabe_symfony_console::formatter::OutputFormatterInterface; use shirabe_symfony_console::formatter::OutputFormatterStyleInterface; @@ -72,15 +72,9 @@ impl HtmlOutputFormatter { ))) } - fn format_html(&self, matches: &PregMatchedGroups) -> String { - let codes_str = matches - .get(&CaptureKey::ByIndex(1)) - .map(|s| s.as_str()) - .unwrap_or(""); - let content = matches - .get(&CaptureKey::ByIndex(2)) - .map(|s| s.as_str()) - .unwrap_or(""); + fn format_html(&self, matches: &PregMatches) -> String { + let codes_str = matches.get(&CaptureKey::ByIndex(1)).unwrap_or(""); + let content = matches.get(&CaptureKey::ByIndex(2)).unwrap_or(""); let mut out = String::from("<span style=\""); for code_str in codes_str.split(';') { |
