Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsIrl committed Nov 17, 2024
1 parent 2d0cf5c commit 1bebe48
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bindgen/ir/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,14 @@ impl Enum {
out.write("enum ");
}

write!(out, "{} tag;", tag_name, self.annotations.atom("tag-field-name").map_or(&"tag", |tag_field_name| tag_field_name.expect("tag-field-name")));
{
let binding = self.annotations.atom("tag-field-name");
let tag_field_name = binding
.as_ref()
.map_or("tag", |tag_field_name| tag_field_name.as_ref().unwrap());

write!(out, "{} {};", tag_name, tag_field_name);
}

if wrap_tag {
out.close_brace(true);
Expand Down

0 comments on commit 1bebe48

Please sign in to comment.