use termcolor::Ansi; use termcolor_output::colored; fn main() { let mut w: Ansi> = Ansi::new(vec![]); match colored!( w, "Text: {}\nText (escaped): {:?}\nNumbers pair: {:?}\nOption: {:#?}", "Text 1", "Text 2 - with \"something else\", \\-_-/!", (100, 100.1), Some(Some(Some(()))) ) { Ok(_) => print!("{}", String::from_utf8_lossy(&w.into_inner())), Err(_) => {} }; }