Skip to content

Commit

Permalink
feat(flecs_ecs_derive): repr C components implement Component<Struct>…
Browse files Browse the repository at this point in the history
… now as well
  • Loading branch information
Indra-db committed Jan 7, 2025
1 parent cb296d0 commit 23d0d70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flecs_ecs_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use syn::{
/// When a type is decorated with `#[derive(Component)]`, several trait implementations are automatically added based on its structure:
///
/// - Depending on whether the type is a struct or Rust enum or `repr(C)` enum.
/// when it's a struct or Rust Enum it implements`ComponentType<Struct>` and in a C compatible enum the `ComponentType<Enum>` trait is implemented.
/// when it's a struct or Rust Enum it implements`ComponentType<Struct>` and in a C compatible enum the `ComponentType<Enum>` trait is also implemented.
/// - Based on the presence of fields or variants, the type will implement either `TagComponent` or `DataComponent`.
/// - The `ComponentId` trait is implemented, providing storage mechanisms for the component.
///
Expand Down Expand Up @@ -817,6 +817,7 @@ fn impl_cached_component_data_enum(ast: &mut syn::DeriveInput) -> proc_macro2::T

quote! {
impl #impl_generics flecs_ecs::core::ComponentType<flecs_ecs::core::Enum> for #name #type_generics #where_clause {}
impl #impl_generics flecs_ecs::core::ComponentType<flecs_ecs::core::Struct> for #name #type_generics #where_clause {}

#component_info

Expand Down

0 comments on commit 23d0d70

Please sign in to comment.