macro_rules! format_atom {
($alloc:expr, $($arg:tt)*) => { ... };
}Expand description
Creates an Atom using interpolation of runtime expressions.
Identical to std’s format! macro, except:
The string is built in the arena, without allocating an intermediate String.
§Panics
Panics if a formatting trait implementation returns an error.
§Example
use oxc_allocator::Allocator;
use oxc_str::format_atom;
let allocator = Allocator::new();
let s1 = "foo";
let s2 = "bar";
let formatted = format_atom!(&allocator, "{s1}.{s2}");
assert_eq!(formatted, "foo.bar");