exact_format
A procedural macro for compile time string replacement without using the standard format placeholder syntax ({}). This is most useful when dealing with strings that contain { } blocks you do no wish to interpolate e.g. writing javascript.
Usage
The exact_format! macro allows you to replace exact string matches within a template:
use exact_format;
// Basic replacement
let result = exact_format!;
assert_eq!;
// JavaScript-style template string replacement
let user_id = 42;
let user_name = "John";
let result = exact_format!;
assert_eq!;
How It Works
The macro expands to a format! call that handles the replacements. For example:
exact_format!;
Expands to:
Rules
- The first argument must be a string literal
- Each replacement key must be a string literal
- Replacement values can be any expression that can be formatted with
{} - The order of replacements matters when keys overlap