From 9108d1e4f11f1066314d4df9502478e6958c9d3d Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 4 Dec 2025 14:49:09 -0800 Subject: [PATCH 1/2] Inline register_type_data to cut down on binary size --- crates/bevy_reflect/src/type_registry.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bevy_reflect/src/type_registry.rs b/crates/bevy_reflect/src/type_registry.rs index bf1950b7af9cb..498921b14e04d 100644 --- a/crates/bevy_reflect/src/type_registry.rs +++ b/crates/bevy_reflect/src/type_registry.rs @@ -590,6 +590,7 @@ impl TypeRegistration { /// Inserts the [`TypeData`] instance of `T` created for `V`, and inserts any /// [`TypeData`] dependencies for that combination of `T` and `V`. + #[inline] pub fn register_type_data, V>(&mut self) { self.insert(T::from_type()); T::insert_dependencies(self); @@ -757,6 +758,7 @@ pub trait FromType { /// Inserts [`TypeData`] dependencies of this [`TypeData`]. /// This is especially useful for trait [`TypeData`] that has a supertrait (ex: `A: B`). /// When the [`TypeData`] for `A` is inserted, the `B` [`TypeData`] will also be inserted. + // #[inline] fn insert_dependencies(_type_registration: &mut TypeRegistration) {} } From 9c63797d71f9dc4b5b7f4366a32d68fe8f48876d Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 4 Dec 2025 15:04:28 -0800 Subject: [PATCH 2/2] Remove commented out code --- crates/bevy_reflect/src/type_registry.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/bevy_reflect/src/type_registry.rs b/crates/bevy_reflect/src/type_registry.rs index 498921b14e04d..8ccd81ce710f7 100644 --- a/crates/bevy_reflect/src/type_registry.rs +++ b/crates/bevy_reflect/src/type_registry.rs @@ -758,7 +758,6 @@ pub trait FromType { /// Inserts [`TypeData`] dependencies of this [`TypeData`]. /// This is especially useful for trait [`TypeData`] that has a supertrait (ex: `A: B`). /// When the [`TypeData`] for `A` is inserted, the `B` [`TypeData`] will also be inserted. - // #[inline] fn insert_dependencies(_type_registration: &mut TypeRegistration) {} }