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
39
40
41
42
43
44
/// Creates a `NonEmptyString` from a string literal at compile time.
///
/// This macro ensures that the provided string is **not empty** at compile time,
/// preventing runtime errors due to empty strings.
///
/// # Examples
///
/// ```
/// use non_empty_string::{non_empty, NonEmptyString};
///
/// let s: NonEmptyString = non_empty!("Hello, Rust!");
/// assert_eq!(s, NonEmptyString::new("Hello, Rust!".to_string()).unwrap());
/// ```
///
/// # Compile-time Failure
///
/// If an empty string is provided, this macro will cause a **compile-time error**.
///
/// ```compile_fail
/// use non_empty_string::non_empty;
///
/// let s = non_empty!("");
/// ```