From eecf733d513a688ffcc4d9280e8965a7c2b6c49a Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 9 Jul 2026 00:11:08 +0200 Subject: fix(engine-ecs-macros): prevent ambigous item usage in IntoParts impls --- engine-ecs-macros/src/lib.rs | 20 +++++--------------- 1 file 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(::name(&self)) .type_reflection(::type_reflection()) - .build(Self::id(), self) + .build(::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(::name(&self)) .type_reflection(::type_reflection()) - .build(Self::id(), self) + .build(::id(), self) } } } @@ -278,7 +269,6 @@ pub fn sole_derive(input: TokenStream) -> TokenStream .into() } - enum TypeItem { Struct(ItemStruct), -- cgit v1.2.3-18-g5258