mirror of
https://github.com/bevyengine/bevy
synced 2024-11-29 08:00:20 +00:00
Add Archetype TypeInfo::type_name accessor (#985)
This commit is contained in:
parent
915024bf35
commit
c346d282b6
1 changed files with 6 additions and 2 deletions
|
@ -484,7 +484,6 @@ pub struct TypeInfo {
|
|||
id: TypeId,
|
||||
layout: Layout,
|
||||
drop: unsafe fn(*mut u8),
|
||||
#[cfg(debug_assertions)]
|
||||
type_name: &'static str,
|
||||
}
|
||||
|
||||
|
@ -499,7 +498,6 @@ impl TypeInfo {
|
|||
id: TypeId::of::<T>(),
|
||||
layout: Layout::new::<T>(),
|
||||
drop: drop_ptr::<T>,
|
||||
#[cfg(debug_assertions)]
|
||||
type_name: core::any::type_name::<T>(),
|
||||
}
|
||||
}
|
||||
|
@ -519,6 +517,12 @@ impl TypeInfo {
|
|||
pub(crate) unsafe fn drop(&self, data: *mut u8) {
|
||||
(self.drop)(data)
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[inline]
|
||||
pub fn type_name(&self) -> &'static str {
|
||||
self.type_name
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for TypeInfo {
|
||||
|
|
Loading…
Reference in a new issue