Debian Codegraph @

src/case.rs

raw symbols SCIP
1 use craterust-analyzer cargo reword 7.0.1 crate/::{foldrust-analyzer cargo reword 7.0.1 fold()., namerust-analyzer cargo reword 7.0.1 name/, name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().};
2 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#;
3
4 fn patrust-analyzer cargo reword 7.0.1 case/pat().(c: char) -> bool {
5 c.is_ascii_punctuationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_punctuation().() || c.is_whitespacerust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_whitespace().()
6 }
7
8 /// Formats the input string as a kebab case name.
9 ///
10 /// # Examples
11 /// ```
12 /// assert_eq!(reword::kebab_case("Even Olsson Rogstadkjærnet"), "even-olsson-rogstadkjærnet");
13 /// ```
14 pub fn kebab_caserust-analyzer cargo reword 7.0.1 case/kebab_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
15 namerust-analyzer cargo reword 7.0.1 name/name().(t)
16 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
17 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
18 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().)
19 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_kebab_caserust-analyzer cargo reword 7.0.1 case/fold_kebab_case().)
20 }
21
22 /// Formats the input string as a kebab case name and limits the length of the name.
23 ///
24 /// # Examples
25 /// ```
26 /// assert_eq!(reword::kebab_case_with_limit("Even Olsson Rogstadkjærnet", 25), "even-o-rogstadkjærnet");
27 /// ```
28 pub fn kebab_case_with_limitrust-analyzer cargo reword 7.0.1 case/kebab_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
29 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
30 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
31 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
32 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().)
33 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_kebab_caserust-analyzer cargo reword 7.0.1 case/fold_kebab_case().)
34 }
35
36 /// Formats the input string as a screaming kebab case name.
37 ///
38 /// # Examples
39 /// ```
40 /// assert_eq!(reword::screaming_kebab_case("Even Olsson Rogstadkjærnet"), "EVEN-OLSSON-ROGSTADKJÆRNET");
41 /// ```
42 pub fn screaming_kebab_caserust-analyzer cargo reword 7.0.1 case/screaming_kebab_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
43 namerust-analyzer cargo reword 7.0.1 name/name().(t)
44 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
45 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
46 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_uppercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_uppercase().)
47 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_kebab_caserust-analyzer cargo reword 7.0.1 case/fold_kebab_case().)
48 }
49
50 /// Formats the input string as a screaming kebab case name and limits the length of the name.
51 ///
52 /// # Examples
53 /// ```
54 /// assert_eq!(reword::screaming_kebab_case_with_limit("Even Olsson Rogstadkjærnet", 25), "EVEN-O-ROGSTADKJÆRNET");
55 /// ```
56 pub fn screaming_kebab_case_with_limitrust-analyzer cargo reword 7.0.1 case/screaming_kebab_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
57 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
58 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
59 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
60 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_uppercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_uppercase().)
61 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_kebab_caserust-analyzer cargo reword 7.0.1 case/fold_kebab_case().)
62 }
63
64 /// Formats the input string as a snake case name.
65 ///
66 /// # Examples
67 /// ```
68 /// assert_eq!(reword::snake_case("Even Olsson Rogstadkjærnet"), "even_olsson_rogstadkjærnet");
69 /// ```
70 pub fn snake_caserust-analyzer cargo reword 7.0.1 case/snake_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
71 namerust-analyzer cargo reword 7.0.1 name/name().(t)
72 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
73 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
74 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().)
75 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_snake_caserust-analyzer cargo reword 7.0.1 case/fold_snake_case().)
76 }
77
78 /// Formats the input string as a snake case name and limits the length of the name.
79 ///
80 /// # Examples
81 /// ```
82 /// assert_eq!(reword::snake_case_with_limit("Even Olsson Rogstadkjærnet", 25), "even_o_rogstadkjærnet");
83 /// ```
84 pub fn snake_case_with_limitrust-analyzer cargo reword 7.0.1 case/snake_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
85 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
86 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
87 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
88 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().)
89 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_snake_caserust-analyzer cargo reword 7.0.1 case/fold_snake_case().)
90 }
91
92 /// Formats the input string as a screaming snake case name.
93 ///
94 /// # Examples
95 /// ```
96 /// assert_eq!(reword::screaming_snake_case("Even Olsson Rogstadkjærnet"), "EVEN_OLSSON_ROGSTADKJÆRNET");
97 /// ```
98 pub fn screaming_snake_caserust-analyzer cargo reword 7.0.1 case/screaming_snake_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
99 namerust-analyzer cargo reword 7.0.1 name/name().(t)
100 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
101 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
102 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_uppercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_uppercase().)
103 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_snake_caserust-analyzer cargo reword 7.0.1 case/fold_snake_case().)
104 }
105
106 /// Formats the input string as a screaming snake case name and limits the length of the name.
107 ///
108 /// # Examples
109 /// ```
110 /// assert_eq!(reword::screaming_snake_case_with_limit("Even Olsson Rogstadkjærnet", 25), "EVEN_O_ROGSTADKJÆRNET");
111 /// ```
112 pub fn screaming_snake_case_with_limitrust-analyzer cargo reword 7.0.1 case/screaming_snake_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
113 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
114 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
115 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
116 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(str::to_uppercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_uppercase().)
117 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_snake_caserust-analyzer cargo reword 7.0.1 case/fold_snake_case().)
118 }
119
120 /// Formats the input string as a camel case name.
121 ///
122 /// # Examples
123 /// ```
124 /// assert_eq!(reword::camel_case("Even Olsson Rogstadkjærnet"), "evenOlssonRogstadkjærnet");
125 /// ```
126 pub fn camel_caserust-analyzer cargo reword 7.0.1 case/camel_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
127 namerust-analyzer cargo reword 7.0.1 name/name().(t)
128 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
129 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
130 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
131 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(i, word)| to_camel_caserust-analyzer cargo reword 7.0.1 case/to_camel_case().(word, i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0))
132 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_camel_caserust-analyzer cargo reword 7.0.1 case/fold_camel_case().)
133 }
134
135 /// Formats the input string as a camel case name with a limit on the length.
136 ///
137 /// # Examples
138 /// ```
139 /// assert_eq!(reword::camel_case_with_limit("Even Olsson Rogstadkjærnet", 25), "evenORogstadkjærnet");
140 /// ```
141 pub fn camel_case_with_limitrust-analyzer cargo reword 7.0.1 case/camel_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
142 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
143 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
144 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
145 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
146 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(i, word)| to_camel_caserust-analyzer cargo reword 7.0.1 case/to_camel_case().(word, i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0))
147 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_camel_caserust-analyzer cargo reword 7.0.1 case/fold_camel_case().)
148 }
149
150 /// Formats the input string as a pascal case name.
151 ///
152 /// # Examples
153 /// ```
154 /// assert_eq!(reword::pascal_case("Even Olsson Rogstadkjærnet"), "EvenOlssonRogstadkjærnet");
155 /// ```
156 pub fn pascal_caserust-analyzer cargo reword 7.0.1 case/pascal_case().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
157 namerust-analyzer cargo reword 7.0.1 name/name().(t)
158 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
159 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
160 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|word| to_camel_caserust-analyzer cargo reword 7.0.1 case/to_camel_case().(word, true))
161 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_camel_caserust-analyzer cargo reword 7.0.1 case/fold_camel_case().)
162 }
163
164 /// Formats the input string as a pascal case name with a limit on the length.
165 ///
166 /// # Examples
167 /// ```
168 /// assert_eq!(reword::pascal_case_with_limit("Even Olsson Rogstadkjærnet", 25), "EvenORogstadkjærnet");
169 /// ```
170 pub fn pascal_case_with_limitrust-analyzer cargo reword 7.0.1 case/pascal_case_with_limit().<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>>(t: T, limit: usize) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
171 name_with_limitrust-analyzer cargo reword 7.0.1 name/name_with_limit().(t, limit)
172 .splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(patrust-analyzer cargo reword 7.0.1 case/pat().)
173 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|t| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().t.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().())
174 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|word| to_camel_caserust-analyzer cargo reword 7.0.1 case/to_camel_case().(word, true))
175 .foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/map/impl#[`Map<I, F>`][Iterator]fold().(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(), fold_camel_caserust-analyzer cargo reword 7.0.1 case/fold_camel_case().)
176 }
177
178 fn to_camel_caserust-analyzer cargo reword 7.0.1 case/to_camel_case().(word: &str, mut upper: bool) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
179 let mut cc = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
180 let mut prev_is_lowercase = false;
181
182 for c in word.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().() {
183 if upper {
184 cc.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Extend<char>`]extend().(c.to_uppercaserust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]to_uppercase().());
185 } else {
186 cc.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Extend<char>`]extend().(c.to_lowercaserust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]to_lowercase().());
187 }
188
189 upper = prev_is_lowercase && c.is_uppercaserust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_uppercase().();
190 prev_is_lowercase = c.is_lowercaserust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_lowercase().();
191 }
192
193 cc
194 }
195
196 fn fold_kebab_caserust-analyzer cargo reword 7.0.1 case/fold_kebab_case().(acc: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, w: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
197 foldrust-analyzer cargo reword 7.0.1 fold().(acc, &w, '-')
198 }
199
200 fn fold_snake_caserust-analyzer cargo reword 7.0.1 case/fold_snake_case().(acc: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, w: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
201 foldrust-analyzer cargo reword 7.0.1 fold().(acc, &w, '_')
202 }
203
204 fn fold_camel_caserust-analyzer cargo reword 7.0.1 case/fold_camel_case().(mut acc: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, w: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
205 let start_is_num = matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(w.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) if c.is_numericrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_numeric().());
206 let end_is_num = matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(acc.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().lastrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]last().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) if c.is_numericrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_numeric().());
207 // Split with _ if two word boundaries are numeric.
208 if start_is_num && end_is_num {
209 acc.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('_');
210 }
211 acc.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&w);
212 acc
213 }