cgp-macro-lib 0.7.0

Context-generic programming core component macros implemented as a library.
Documentation
1
2
3
4
5
6
7
8
9
10
pub fn to_camel_case_str(val: &str) -> String {
    val.split('_')
        .filter(|word| !word.is_empty())
        .flat_map(|word| {
            word.chars()
                .enumerate()
                .map(|(i, c)| if i == 0 { c.to_ascii_uppercase() } else { c })
        })
        .collect()
}