Skip to content

Commit

Permalink
nit: early return for alias_to != name
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgo committed Apr 24, 2024
1 parent b21af5a commit 785ca19
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,12 +1163,11 @@ impl Parser {
quote! { #[derive(Copy, Clone, Debug, Default, PartialEq)] }
};
let aliases = self.struct_aliases.iter().map(|(alias, alias_to)| {
if alias_to == name {
let alias_ident = xr_ty_name(alias);
quote! { pub type #alias_ident = #ident; }
} else {
quote! {}
if alias_to != name {
return quote! {};
}
let alias_ident = xr_ty_name(alias);
quote! { pub type #alias_ident = #ident; }
});
quote! {
#[repr(C)]
Expand Down

0 comments on commit 785ca19

Please sign in to comment.