MCPcopy Index your code
hub / github.com/eventuallyconsultant/codegenr / del_char_tests

Function del_char_tests

codegenr/src/helpers/string_ext.rs:220–227  ·  view source on GitHub ↗

todo: #[test_case("test", " t", "es")]

(v: &str, trimmer: &str, expected: &str)

Source from the content-addressed store, hash-verified

218 }
219
220 fn pascal_case(&self) -> String {
221 let (_, pascal) = self.trim().chars().fold((Some(true), String::with_capacity(self.len())), |acc, x| {
222 let (upper_next, mut s) = acc;
223 if is_out_of_case(x) {
224 return (Some(true), s);
225 }
226 match upper_next {
227 Some(true) => s.push(x.to_uppercase().next().unwrap_or(x)),
228 _ => s.push(x),
229 }
230 (Some(false), s)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected