Skip to content

Commit

Permalink
Remove workaround for empty structs
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed May 2, 2024
1 parent 8724e22 commit 5ac1097
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions crates/libs/bindgen/src/rust/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ pub fn writer(writer: &Writer, def: metadata::TypeDef) -> TokenStream {

fn gen_struct_with_name(writer: &Writer, def: metadata::TypeDef, struct_name: &str, cfg: &cfg::Cfg) -> TokenStream {
let name = to_ident(struct_name);

if def.fields().next().is_none() {
let mut tokens = quote! {
#[repr(C)]
pub struct #name(pub u8);
impl Copy for #name {}
impl Clone for #name {
fn clone(&self) -> Self {
*self
}
}
};
if !writer.sys {
tokens.combine(&quote! {
impl windows_core::TypeKind for #name {
type TypeKind = windows_core::CopyType;
}
});
}
return tokens;
}

let flags = def.flags();
let cfg = cfg.union(cfg::type_def_cfg(writer, def, &[]));

Expand Down

0 comments on commit 5ac1097

Please sign in to comment.