From 793d81c7dae9e681349e7850da3a3934188bcfb4 Mon Sep 17 00:00:00 2001 From: Gino Valente Date: Tue, 23 Aug 2022 23:29:30 -0700 Subject: [PATCH] Added missing GetTypeRegistration impl for SmallVec --- crates/bevy_reflect/src/impls/smallvec.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/bevy_reflect/src/impls/smallvec.rs b/crates/bevy_reflect/src/impls/smallvec.rs index 61d507986b15a..161e0312049b2 100644 --- a/crates/bevy_reflect/src/impls/smallvec.rs +++ b/crates/bevy_reflect/src/impls/smallvec.rs @@ -3,7 +3,8 @@ use std::any::Any; use crate::utility::GenericTypeInfoCell; use crate::{ - Array, ArrayIter, FromReflect, List, ListInfo, Reflect, ReflectMut, ReflectRef, TypeInfo, Typed, + Array, ArrayIter, FromReflect, FromType, GetTypeRegistration, List, ListInfo, Reflect, + ReflectFromPtr, ReflectMut, ReflectRef, TypeInfo, TypeRegistration, Typed, }; impl Array for SmallVec @@ -139,3 +140,14 @@ where } } } + +impl GetTypeRegistration for SmallVec +where + T::Item: FromReflect + Clone, +{ + fn get_type_registration() -> TypeRegistration { + let mut registration = TypeRegistration::of::>(); + registration.insert::(FromType::>::from_type()); + registration + } +}