pub(crate) fn rename_classes(&self, documentation: &mut Documentation) {
        let replace = |name: &mut String| {
            if let Some(rename) = self.rename_classes.get(name) {
                *name = rename.clone();
            } else if let Some(rename) = self.rust_to_godot.get(name) {
                *name = rename.clone();
            }
        };

        let mut renamed_classes = HashMap::new();
        let classes = std::mem::take(&mut documentation.classes);
        for (mut name, mut class) in classes {
            for method in &mut class.methods {
                for (_, typ, _) in &mut method.parameters {
                    match typ {
                        documentation::Type::Option(name) | documentation::Type::Named(name) => {
                            replace(name)
                        }
                        documentation::Type::Unit => {}
                    }
                }
                match &mut method.return_type {
                    documentation::Type::Option(name) | documentation::Type::Named(name) => {
                        replace(name)
                    }
                    documentation::Type::Unit => {}
                }
            }
            for property in &mut class.properties {
                match &mut property.typ {
                    Type::Option(name) | Type::Named(name) => replace(name),
                    Type::Unit => {}
                }
            }
            replace(&mut name);
            replace(&mut class.inherit);
            renamed_classes.insert(name, class);
        }
        documentation.classes = renamed_classes;
    }
/// Convert all type names from Rust to Godot.
///
/// This will convert `i32` to `int`, `Int32Array` to `PoolIntArray`...
///
/// See [`ConfigFile::rename_classes`] for user-defined renaming.
Convert all type names from Rust to Godot.


Convert all type names from Rust to Godot .
pub(crate) fn rename_classes(&self, documentation: &mut Documentation) {
        let replace = |name: &mut String| {
            if let Some(rename) = self.rename_classes.get(name) {
                *name = rename.clone();
            } else if let Some(rename) = self.rust_to_godot.get(name) {
                *name = rename.clone();
            }
        };
        let mut renamed_classes = HashMap::new();
        let classes = std::mem::take(&mut documentation.classes);
        for (mut name, mut class) in classes {
            for method in &mut class.methods {
                for (_, typ, _) in &mut method.parameters {
                    match typ {
                        documentation::Type::Option(name) | documentation::Type::Named(name) => {
                            replace(name)
                        }
                        documentation::Type::Unit => {}
                    }
                }
                match &mut method.return_type {
                    documentation::Type::Option(name) | documentation::Type::Named(name) => {
                        replace(name)
                    }
                    documentation::Type::Unit => {}
                }
            }
            for property in &mut class.properties {
                match &mut property.typ {
                    Type::Option(name) | Type::Named(name) => replace(name),
                    Type::Unit => {}
                }
            }
            replace(&mut name);
            replace(&mut class.inherit);
            renamed_classes.insert(name, class);
        }
        documentation.classes = renamed_classes;
    }
pub ( crate ) fn rename_classes ( & self , documentation : & mut Documentation ) { let replace = | name : & mut String | { if let Some ( rename ) = self . rename_classes . get ( name ) { * name = rename . clone ( ) ; } else if let Some ( rename ) = self . rust_to_godot . get ( name ) { * name = rename . clone ( ) ; } } ; let mut renamed_classes = HashMap :: new ( ) ; let classes = std :: mem :: take ( & mut documentation . classes ) ; for ( mut name , mut class ) in classes { for method in & mut class . methods { for ( _ , typ , _ ) in & mut method . parameters { match typ { documentation :: Type :: Option ( name ) | documentation :: Type :: Named ( name ) => { replace ( name ) } documentation :: Type :: Unit => { } } } match & mut method . return_type { documentation :: Type :: Option ( name ) | documentation :: Type :: Named ( name ) => { replace ( name ) } documentation :: Type :: Unit => { } } } for property in & mut class . properties { match & mut property . typ { Type :: Option ( name ) | Type :: Named ( name ) => replace ( name ) , Type :: Unit => { } } } replace ( & mut name ) ; replace ( & mut class . inherit ) ; renamed_classes . insert ( name , class ) ; } documentation . classes = renamed_classes ; }
Convert all type names from Rust to Godot.
Convert all type names from Rust to Godot .
&self
documentation
&mut Documentation
&self
documentation
&mut Documentation