From 5e31fa33c3b5cf726a57a063b8e7a070869250fe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 19 May 2026 21:46:01 +0900 Subject: fix(compile): fix more random compile errors Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/shirabe/src/console/html_output_formatter.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/console/html_output_formatter.rs') diff --git a/crates/shirabe/src/console/html_output_formatter.rs b/crates/shirabe/src/console/html_output_formatter.rs index c7be6ee..a0099e5 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_external_packages::composer::pcre::preg::Preg; +use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; use shirabe_external_packages::symfony::console::formatter::output_formatter::OutputFormatter; use shirabe_external_packages::symfony::console::formatter::output_formatter_style::OutputFormatterStyle; @@ -58,12 +58,18 @@ impl HtmlOutputFormatter { clear_escape_codes, clear_escape_codes ); - Preg::replace_callback(&pattern, |matches| self.format_html(matches), formatted).ok() + Preg::replace_callback(&pattern, |matches| self.format_html(matches), &formatted).ok() } - fn format_html(&self, matches: Vec>) -> String { - let codes_str = matches[1].as_deref().unwrap_or(""); - let content = matches[2].as_deref().unwrap_or(""); + fn format_html(&self, matches: &IndexMap) -> 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(""); let mut out = String::from("