Formats any number of arguments without heap allocation.
Additionally, the library provides macro optional_arg
which may be
required when programming macros with optional arguments.
When macro is used as an argument to format_all_args
,
additional parentheses must be used.
main.rs
```rust use formatallargs::{formatallargs, optional_arg};
fn main() { macrorules! optionalargtest { ( $($a:expr)? ) => { optionalarg!($($a)?) }; } // ----------^ -----^ // optional optional // let result = format!("{}", formatallargs!(1,2,3,4,5,(optionalargtest!( )),7)); // ^ ^ ^ // | | // +---------------------+ // additional parentheses assert_eq!(result, "123457"); } ```