macro_rules! format_utf16 {
(in $arena:expr, $($arg:tt)*) => { ... };
}Available on crate feature
utf16 only.Expand description
format!-style macro that writes into a fresh arena-backed
Utf16String.
Freeze the result with Utf16String::into_boxed_utf16_str
if you want an immutable Box<Utf16Str>.
§Panics
Panics on allocation failure or if a formatter returns Err.
§Example
use widestring::utf16str;
let arena = multitude::Arena::new();
let name = "Alice";
let s = multitude::strings::format_utf16!(in &arena, "Hello, {name}!");
assert_eq!(s.as_utf16_str(), utf16str!("Hello, Alice!"));