Macro interpolator::iformat

source ·
macro_rules! iformat {
    ($fmt:expr, $($context:tt)*) => { ... };
}
Expand description

format() as a macro to allow specifying the context directly.

For details on the context syntax see context!.

use interpolator::iformat;

assert_eq!(
    iformat!("{a}, {b:?}", a = 10, b:? = "test").unwrap(),
    "10, \"test\""
)