Skip to main content

cstr

Macro cstr 

Source
cstr!() { /* proc-macro */ }
Expand description

Colorizes a string literal, without formatting the format!-like placeholders.

Accepts only one argument.

ยงExample
let s: &str = cstr!("A <g>green</> word");
assert_eq!(s, "A \u{1b}[32mgreen\u{1b}[39m word");