diff --git a/crates/turborepo-ui/src/color_selector.rs b/crates/turborepo-ui/src/color_selector.rs index 2a42c4cf5c7e7..bbe761f8d31ec 100644 --- a/crates/turborepo-ui/src/color_selector.rs +++ b/crates/turborepo-ui/src/color_selector.rs @@ -4,7 +4,7 @@ use std::{ sync::{Arc, OnceLock, RwLock}, }; -use console::Style; +use console::{Style, StyledObject}; static COLORS: OnceLock<[Style; 5]> = OnceLock::new(); @@ -49,13 +49,13 @@ impl ColorSelector { color } - pub fn prefix_with_color(&self, cache_key: &str, prefix: &str) -> Cow<'static, str> { + pub fn prefix_with_color(&self, cache_key: &str, prefix: &str) -> StyledObject { if prefix.is_empty() { - return "".into(); + return Style::new().apply_to(String::new()); } let style = self.color_for_key(cache_key); - style.apply_to(format!("{}: ", prefix)).to_string().into() + style.apply_to(format!("{}: ", prefix)) } }