Function fmt_fn
Source pub const fn fmt_fn<F>(f: F) -> FmtFn<F>
Expand description
Creates an object that implements Debug and Display based on the provided function object.
Example:
let fmt = fmt_tools::fmt_fn(|f| f.write_str("foo"));
assert_eq!(format!("{fmt:?}"), "foo");
assert_eq!(format!("{fmt}"), "foo");