Skip to content

Commit

Permalink
- add: missing derive directives
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenX8 committed Nov 28, 2024
1 parent c26e650 commit c04ce0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions generator/src/codegen/rust/codegen_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ impl<'a, W: Write> CodeSourceGenerator<'a, W> {

if is_enum {
cg!(self, r#"#[repr({})]"#, rust_type);
cg!(self, r#"#[derive(Debug, Encode, Decode)]"#);
cg!(self, "enum {} {{", name.to_upper_camel_case());
self.indent();
for content in restrict.contents() {
Expand All @@ -261,6 +262,7 @@ impl<'a, W: Write> CodeSourceGenerator<'a, W> {
}
}
} else {
cg!(self, r#"#[derive(Debug, Encode, Decode)]"#);
cg!(self, "struct {} {{", name.to_upper_camel_case());
self.indent();
cg!(self, "{}: {},", name.to_string().to_snake_case(), rust_type);
Expand Down

0 comments on commit c04ce0b

Please sign in to comment.