From 2cd3d8fece9e2582abc6b6e70d94f28e3e0921bf Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 11 Jun 2026 18:07:35 +0200 Subject: fix(engine): use std::any::type_name for field type name reflection --- engine-reflection/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine-reflection/src') diff --git a/engine-reflection/src/lib.rs b/engine-reflection/src/lib.rs index c884edb..bad26df 100644 --- a/engine-reflection/src/lib.rs +++ b/engine-reflection/src/lib.rs @@ -127,13 +127,18 @@ pub struct Field pub byte_offset: usize, pub type_id: TypeId, - pub type_name: &'static str, + pub get_type_name: FnWithDebug<&'static str>, pub get_type: FnWithDebug>, pub visibility: Visibility, } impl Field { + pub fn type_name(&self) -> &'static str + { + self.get_type_name.get() + } + pub fn type_reflection(&self) -> Option<&'static Type> { self.get_type.get() -- cgit v1.2.3-18-g5258