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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
mod converter;
pub mod snake_case;
pub mod pascal_case;
pub mod kebab_case;
pub mod camel_case;
pub mod upper_first;
pub mod sentence_case;
pub mod title_case;
pub use self::snake_case::{to_snake_case, to_snake_caps_case};
pub use self::kebab_case::{to_kebab_case};
pub use self::camel_case::{to_camel_case};
pub use self::pascal_case::{to_pascal_case};
pub use self::upper_first::{to_upper_first};
pub use self::sentence_case::{to_sentence_case};
pub use self::title_case::{to_title_case};
pub trait Morph {
fn to_snake_case(&self) -> String;
fn to_snake_caps_case(&self) -> String;
fn to_kebab_case(&self) -> String;
fn to_camel_case(&self) -> String;
fn to_pascal_case(&self) -> String;
fn to_sentence_case(&self) -> String;
fn to_title_case(&self) -> String;
fn to_upper_first(&self) -> String;
}
impl<'a> Morph for String {
fn to_snake_case(&self) -> String { to_snake_case(&self)}
fn to_snake_caps_case(&self) -> String { to_snake_caps_case(&self)}
fn to_kebab_case(&self) -> String { to_kebab_case(&self)}
fn to_camel_case(&self) -> String { to_camel_case(&self)}
fn to_pascal_case(&self) -> String { to_pascal_case(&self)}
fn to_sentence_case(&self) -> String { to_sentence_case(&self)}
fn to_title_case(&self) -> String { to_title_case(&self)}
fn to_upper_first(&self) -> String { to_upper_first(&self)}
}
impl<'a> Morph for str {
fn to_snake_case(&self) -> String { to_snake_case(&self)}
fn to_snake_caps_case(&self) -> String { to_snake_caps_case(&self)}
fn to_kebab_case(&self) -> String { to_kebab_case(&self)}
fn to_camel_case(&self) -> String { to_camel_case(&self)}
fn to_pascal_case(&self) -> String { to_pascal_case(&self)}
fn to_sentence_case(&self) -> String { to_sentence_case(&self)}
fn to_title_case(&self) -> String { to_title_case(&self)}
fn to_upper_first(&self) -> String { to_upper_first(&self)}
}