Rust: Rename classes with Record to Struct

This commit is contained in:
Simon Friis Vindum
2025-03-19 10:37:10 +01:00
parent 179bae8791
commit b2b650ddd3
155 changed files with 1968 additions and 1933 deletions

View File

@@ -23,6 +23,9 @@ fn class_name(type_name: &str) -> String {
"Literal" => "LiteralExpr".to_owned(),
"ArrayExpr" => "ArrayExprInternal".to_owned(),
"AsmOptions" => "AsmOptionsList".to_owned(),
_ if type_name.starts_with("Record") && type_name != "RecordFieldList" => {
type_name.replacen("Record", "Struct", 1)
}
_ if type_name.ends_with("Type") => format!("{}Repr", type_name),
_ => type_name.to_owned(),
}
@@ -40,6 +43,7 @@ fn property_name(type_name: &str, field_name: &str) -> String {
("SelfParam", "is_amp") => "is_ref",
("UseTree", "is_star") => "is_glob",
(_, "ty") => "type_repr",
_ if field_name.contains("record") => &field_name.replacen("record", "struct", 1),
_ => field_name,
};
name.to_owned()