A crate to format and print strings with an embedded rust expression, similar to f-string formatting in Python.
Examples
Using :?
modifier.
use ex_format;
let v = vec!;
assert_eq!;
Using other modifiers (std:fmt
for details).
use ex_format;
// Space after format specs if it doesn't ends in ?
assert_eq!;
assert_eq!;
assert_eq!;
No support for *
and $
parameters.
Printing the contents of fields.
use ex_format;
let arg = ;
assert_eq!;
Short version of ex_format!
with a complex expression.
use exf;
assert_eq!;
Print to standard output with a new line.
use expl; // Short name version of ex_println!
expl!;
// stdout: value of point = Point { x: 3, y: 12 }
Escape brackets with {{
and }}
.
use exf;
let value = 10;
assert_eq!;