interpol
String interpolation macros for rust
Usage
Macros provided by this crate correspond to std's formatting macros (format,print, println, eprint, eprintln, ...).
You can use these macros just same as std's ones.
use println;
let a = 3;
let b = 4;
println!; // => "3 times 4 is 12."
It is also able to specify formatting option:
let pi = 3.14;
println!; // => "3.1400000000"
println!; // => "7b"
let v = vec!;
println!; // => "[1, 2, 3]"
Correctly handles unicode characters:
let world = "世界";
println!; // => "ハロー 世界"
It is able to write expressions:
println!;
// => "PI = 3.1415926536"
println!;
// => "PI = 3.1415926536"
You can also write nested block expressions:
println!; // => "15129"
println!;
// "{{" and "}}" is escaped so the result is:
// => "{ let t = 123; t * t }"