Macro format_compact_str

Source
macro_rules! format_compact_str {
    ($($arg:tt)*) => { ... };
}
Expand description

Creates a CompactStr using interpolation of runtime expressions.

The first argument format_compact_str! receives is a format string. This must be a string literal. The power of the formatting string is in the {}s contained.

Additional parameters passed to format_compact_str! replace the {}s within the formatting string in the order given unless named or positional parameters are used; see std::fmt for more information.

A common use for format_compact_str! is concatenation and interpolation of strings. The same convention is used with print! and write! macros, depending on the intended destination of the string.

ยงPanics

format_compact_str! panics if a formatting trait implementation returns an error.