Skip to content

Commit

Permalink
Add rename from 'use' -> 'usage' in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
exrook committed Oct 25, 2023
1 parent ba1f984 commit 311e449
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autogen/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ pub fn get_param_name(params: &[structs::Operand], param_index: usize) -> Ident

let mut name = raw_name.to_snake_case();

// Rename/remap rust reserved keywords
if name == "type" {
name = "ty".to_owned();
}
if name == "use" {
name = "usage".to_owned();
}

if duplicate_count > 0 {
name = format!("{}_{}", name, duplicate_count + 1);
Expand Down

0 comments on commit 311e449

Please sign in to comment.