diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
| commit | a1c7e6908a26e10f6e1f23a51721664b5e2d838d (patch) | |
| tree | c575c76f1b43359ed74913da4c6a2636643f1ba0 /crates/shirabe/src/console/html_output_formatter.rs | |
| parent | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (diff) | |
| download | php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.gz php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.zst php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.zip | |
chore(style): cargo fmt
Diffstat (limited to 'crates/shirabe/src/console/html_output_formatter.rs')
| -rw-r--r-- | crates/shirabe/src/console/html_output_formatter.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/crates/shirabe/src/console/html_output_formatter.rs b/crates/shirabe/src/console/html_output_formatter.rs index f34ca1b..a69b4c6 100644 --- a/crates/shirabe/src/console/html_output_formatter.rs +++ b/crates/shirabe/src/console/html_output_formatter.rs @@ -1,9 +1,9 @@ //! ref: composer/src/Composer/Console/HtmlOutputFormatter.php +use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; use shirabe_external_packages::symfony::console::formatter::output_formatter::OutputFormatter; use shirabe_external_packages::symfony::console::formatter::output_formatter_style::OutputFormatterStyle; -use indexmap::IndexMap; #[derive(Debug)] pub struct HtmlOutputFormatter { @@ -66,11 +66,19 @@ impl HtmlOutputFormatter { for code_str in codes_str.split(';') { let code: i64 = code_str.parse().unwrap_or(0); - if let Some(&(_, color)) = Self::AVAILABLE_FOREGROUND_COLORS.iter().find(|&&(k, _)| k == code) { + if let Some(&(_, color)) = Self::AVAILABLE_FOREGROUND_COLORS + .iter() + .find(|&&(k, _)| k == code) + { out.push_str(&format!("color:{};", color)); - } else if let Some(&(_, color)) = Self::AVAILABLE_BACKGROUND_COLORS.iter().find(|&&(k, _)| k == code) { + } else if let Some(&(_, color)) = Self::AVAILABLE_BACKGROUND_COLORS + .iter() + .find(|&&(k, _)| k == code) + { out.push_str(&format!("background-color:{};", color)); - } else if let Some(&(_, option)) = Self::AVAILABLE_OPTIONS.iter().find(|&&(k, _)| k == code) { + } else if let Some(&(_, option)) = + Self::AVAILABLE_OPTIONS.iter().find(|&&(k, _)| k == code) + { match option { "bold" => out.push_str("font-weight:bold;"), "underscore" => out.push_str("text-decoration:underline;"), |
