1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/// `format!`-style macro that writes into a fresh arena-backed
/// [`Utf16String`](crate::strings::Utf16String).
///
/// Freeze the result with [`Utf16String::into_arena_box_utf16_str`](crate::strings::Utf16String::into_arena_box_utf16_str)
/// if you want an immutable [`BoxUtf16Str`](crate::strings::BoxUtf16Str).
///
/// # Panics
///
/// Panics on allocation failure or if a formatter returns `Err`.
///
/// # Example
///
/// ```
/// # #[cfg(feature = "utf16")] {
/// 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!"));
/// # }
/// ```