fn rust_type_name(s: &str) -> String {
    // If it's all uppercase or digits then leave as is
    if s.chars().all(|c| c.is_ascii_uppercase() || c.is_ascii_digit()) {
        return s.to_string();
    }

    // Convert to PascalCase
    s.split(|c: char| c.is_whitespace() || c == '.' || c == '_' || c == '-')
        .map(|component| {
            // Upper first char
            let lower = component.to_ascii_lowercase();
            let mut chars = lower.chars();
            match chars.next() {
                None => String::new(),
                Some(f) => {
                    f.to_uppercase().collect::<String>() + chars.as_str()
                }
            }
        })
        .collect()
}
/// Heuristically produce an appropriate Rust type name.
Heuristically produce an appropriate Rust type name.
Heuristically produce an appropriate Rust type name .
fn rust_type_name(s: &str) -> String {
    // If it's all uppercase or digits then leave as is
    if s.chars().all(|c| c.is_ascii_uppercase() || c.is_ascii_digit()) {
        return s.to_string();
    }
    // Convert to PascalCase
    s.split(|c: char| c.is_whitespace() || c == '.' || c == '_' || c == '-')
        .map(|component| {
            // Upper first char
            let lower = component.to_ascii_lowercase();
            let mut chars = lower.chars();
            match chars.next() {
                None => String::new(),
                Some(f) => {
                    f.to_uppercase().collect::<String>() + chars.as_str()
                }
            }
        })
        .collect()
}
fn rust_type_name ( s : & str ) -> String { // If it's all uppercase or digits then leave as is if s . chars ( ) . all ( | c | c . is_ascii_uppercase ( ) || c . is_ascii_digit ( ) ) { return s . to_string ( ) ; } // Convert to PascalCase s . split ( | c : char | c . is_whitespace ( ) || c == '.' || c == '_' || c == '-' ) . map ( | component | { // Upper first char let lower = component . to_ascii_lowercase ( ) ; let mut chars = lower . chars ( ) ; match chars . next ( ) { None => String :: new ( ) , Some ( f ) => { f . to_uppercase ( ) . collect :: < String > ( ) + chars . as_str ( ) } } } ) . collect ( ) }
Heuristically produce an appropriate Rust type name.
Heuristically produce an appropriate Rust type name .
s
&str
s
&str