to_camel_case in clippy_utils::str_utils - Rust
Description: Returns a `CamelCase` version of the input

Skip to main content

## to_camel_case

# Function 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");