summaryrefslogtreecommitdiff
path: root/engine-ecs-macros
diff options
context:
space:
mode:
Diffstat (limited to 'engine-ecs-macros')
-rw-r--r--engine-ecs-macros/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/engine-ecs-macros/src/lib.rs b/engine-ecs-macros/src/lib.rs
index a95cfe4..7dee49f 100644
--- a/engine-ecs-macros/src/lib.rs
+++ b/engine-ecs-macros/src/lib.rs
@@ -120,9 +120,9 @@ pub fn component_derive(input: TokenStream) -> TokenStream
.type_reflection()
}
- fn name(&self) -> &'static str
+ fn name() -> std::borrow::Cow<'static, str>
{
- std::any::type_name::<Self>()
+ stringify!(#item_ident).into()
}
}
@@ -135,7 +135,7 @@ pub fn component_derive(input: TokenStream) -> TokenStream
fn into_parts(self) -> #ecs_path::component::Parts
{
#ecs_path::component::Parts::builder()
- .name(<Self as Component>::name(&self))
+ .name(<Self as Component>::name())
.type_reflection(<Self as Component>::type_reflection())
.build(
<Self as #ecs_path::component::WithAssociatedId>::id(),
@@ -245,9 +245,9 @@ pub fn sole_derive(input: TokenStream) -> TokenStream
.type_reflection()
}
- fn name(&self) -> &'static str
+ fn name() -> std::borrow::Cow<'static, str>
{
- std::any::type_name::<Self>()
+ stringify!(#item_ident).into()
}
}
@@ -256,7 +256,7 @@ pub fn sole_derive(input: TokenStream) -> TokenStream
fn into_parts(self) -> #ecs_path::component::Parts
{
#ecs_path::component::Parts::builder()
- .name(<Self as Sole>::name(&self))
+ .name(<Self as Sole>::name())
.is_sole(true)
.type_reflection(<Self as Sole>::type_reflection())
.build(