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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/// Converts a string literal to camel case.
///
/// # Examples
/// ```
/// assert_eq!(const_str::to_camel_case!("camel case"), "CamelCase");
/// ```
#[macro_export]
macro_rules! to_camel_case {
    ($s: literal) => {
        $crate::__proc::to_camel_case!($s)
    };
}

/// Converts a string literal to kebab case.
///
/// # Examples
/// ```
/// assert_eq!(const_str::to_kebab_case!("kebab case"), "kebab-case");
/// ```
#[macro_export]
macro_rules! to_kebab_case {
    ($s: literal) => {
        $crate::__proc::to_kebab_case!($s)
    };
}

/// Converts a string literal to snake case.
///
/// # Examples
/// ```
/// assert_eq!(const_str::to_snake_case!("snake case"), "snake_case");
/// ```
#[macro_export]
macro_rules! to_snake_case {
    ($s: literal) => {
        $crate::__proc::to_snake_case!($s)
    };
}

/// Converts a string literal to shouty snake case.
///
/// # Examples
/// ```
/// assert_eq!(const_str::to_shouty_snake_case!("shouty snake case"), "SHOUTY_SNAKE_CASE");
/// ```
#[macro_export]
macro_rules! to_shouty_snake_case {
    ($s: literal) => {
        $crate::__proc::to_shouty_snake_case!($s)
    };
}

/// Converts a string literal to shouty kebab case.
///
/// # Examples
/// ```
/// assert_eq!(const_str::to_shouty_kebab_case!("shouty kebab case"), "SHOUTY-KEBAB-CASE");
/// ```
#[macro_export]
macro_rules! to_shouty_kebab_case {
    ($s: literal) => {
        $crate::__proc::to_shouty_kebab_case!($s)
    };
}