mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Rename classes with Record to Struct
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user