diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-09 00:11:08 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-09 00:11:08 +0200 |
| commit | eecf733d513a688ffcc4d9280e8965a7c2b6c49a (patch) | |
| tree | 598017e81e791e1555f4b97f8145f04a46fe6a64 /engine-ecs-macros/src | |
| parent | 5abf78013d3688d900deb6e1df5afd60954da4e7 (diff) | |
fix(engine-ecs-macros): prevent ambigous item usage in IntoParts impls
Diffstat (limited to 'engine-ecs-macros/src')
| -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), |
