diff options
| -rw-r--r-- | engine-ecs-macros/src/lib.rs | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/engine-ecs-macros/src/lib.rs b/engine-ecs-macros/src/lib.rs index 106d350..da9eec3 100644 --- a/engine-ecs-macros/src/lib.rs +++ b/engine-ecs-macros/src/lib.rs @@ -4,16 +4,7 @@ use std::path::PathBuf as FsPathBuf; use proc_macro::TokenStream; use quote::{format_ident, quote, ToTokens}; use syn::spanned::Spanned; -use syn::{ - parse, - Generics, - Ident, - Item, - ItemEnum, - ItemStruct, - ItemUnion, - Path, -}; +use syn::{parse, Generics, Ident, Item, ItemEnum, ItemStruct, ItemUnion, Path}; use toml::value::{Table as TomlTable, Value as TomlValue}; macro_rules! syn_path { @@ -153,9 +144,9 @@ pub fn component_derive(input: TokenStream) -> TokenStream fn into_parts(self) -> #ecs_path::component::Parts { #ecs_path::component::Parts::builder() - .name(self.name()) + .name(<Self as Component>::name(&self)) .type_reflection(<Self as Component>::type_reflection()) - .build(Self::id(), self) + .build(<Self as Component>::id(), self) } } } @@ -268,9 +259,9 @@ pub fn sole_derive(input: TokenStream) -> TokenStream fn into_parts(self) -> #ecs_path::component::Parts { #ecs_path::component::Parts::builder() - .name(self.name()) + .name(<Self as Sole>::name(&self)) .type_reflection(<Self as Sole>::type_reflection()) - .build(Self::id(), self) + .build(<Self as Sole>::id(), self) } } } @@ -278,7 +269,6 @@ pub fn sole_derive(input: TokenStream) -> TokenStream .into() } - enum TypeItem { Struct(ItemStruct), |
