pub fn separate_camel_case(input: &str) -> String {
    input
        .chars()
        .enumerate()
        .flat_map(|(i, c)| {
            if i > 0 && c.is_ascii_uppercase() {
                vec![' ', c].into_iter()
            } else {
                vec![c].into_iter()
            }
        })
        .collect()
}
/// Returns a string containing spaces inserted before each capital
/// letter (except the first, if the first capital is also the first
/// letter of the input string)
// The vec! expressions are used to get variable length iterators, but
// it could be done better. Revisit if this becomes a bottleneck.
Returns a string containing spaces inserted before each capital
letter (except the first, if the first capital is also the first
letter of the input string)
The vec. expressions are used to get variable length iterators, but
it could be done better. Revisit if this becomes a bottleneck.
Returns a string containing spaces inserted before each capital letter ( except the first if the first capital is also the first letter of the input string ) The vec . expressions are used to get variable length iterators but it could be done better . Revisit if this becomes a bottleneck .
pub fn separate_camel_case(input: &str) -> String {
    input
        .chars()
        .enumerate()
        .flat_map(|(i, c)| {
            if i > 0 && c.is_ascii_uppercase() {
                vec![' ', c].into_iter()
            } else {
                vec![c].into_iter()
            }
        })
        .collect()
}
pub fn separate_camel_case ( input : & str ) -> String { input . chars ( ) . enumerate ( ) . flat_map ( | ( i , c ) | { if i > 0 && c . is_ascii_uppercase ( ) { vec ! [ ' ' c ] . into_iter ( ) } else { vec ! [ c ] . into_iter ( ) } } ) . collect ( ) }
Returns a string containing spaces inserted before each capital
letter (except the first, if the first capital is also the first
letter of the input string)
The vec!
Returns a string containing spaces inserted before each capital letter ( except the first if the first capital is also the first letter of the input string ) The vec!
input
&str
input
&str