Function clippy_utils::str_utils::to_camel_case

source ยท
pub fn to_camel_case(item_name: &str) -> String
Expand description

Returns a CamelCase version of the input

use clippy_utils::str_utils::to_camel_case;
assert_eq!(to_camel_case("abc_def"), "AbcDef");
assert_eq!(to_camel_case("a_b_c_d"), "ABCD");
assert_eq!(to_camel_case("abc_d_d"), "AbcDD");
assert_eq!(to_camel_case("abc1_d_d"), "Abc1DD");