Function format_xml::fmt
source · [−]Expand description
Returns a displayable object using the closure argument as its implementation.
let s = fmtools::fmt(|f| {
f.write_str("display")
});
assert_eq!(s.to_string(), "display");
This is useful to insert ad-hoc formatting code:
println!("Hello {}!", fmtools::fmt(|f| {
f.write_str("world")
}));
// Prints `Hello world!`