chroma/lexers/testdata/rust/string_interpol.actual
2025-03-22 20:46:00 +13:00

29 lines
629 B
Text

fn main() {
let foo = 'x';
println!(
"
Kitchen sink
{{ }} - Escaped
{{{}}} - Escaped with inner interpol
{foo:#?} - Ident with pretty debug format
{0:-<5} - Positional with complex fill/alignment
",
foo,
);
// Unconventional formatting
println! ( "Hello, {foo}!");
// Exhausting the supported macros
eprintln!("{foo}");
eprint!("{foo}");
println!("{foo}");
print!("{foo}");
format!("{foo}");
format_args!("{foo}");
panic!("{foo}");
todo!("{foo}");
unreachable!("{foo}");
unimplemented!("{foo}");
}