Skip to content

Commit

Permalink
Added missing GetTypeRegistration impl for SmallVec
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGVSV committed Aug 24, 2022
1 parent 3d194a2 commit 793d81c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/bevy_reflect/src/impls/smallvec.rs
Expand Up @@ -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<T: smallvec::Array + Send + Sync + 'static> Array for SmallVec<T>
Expand Down Expand Up @@ -139,3 +140,14 @@ where
}
}
}

impl<T: smallvec::Array + Send + Sync + 'static> GetTypeRegistration for SmallVec<T>
where
T::Item: FromReflect + Clone,
{
fn get_type_registration() -> TypeRegistration {
let mut registration = TypeRegistration::of::<SmallVec<T>>();
registration.insert::<ReflectFromPtr>(FromType::<SmallVec<T>>::from_type());
registration
}
}

0 comments on commit 793d81c

Please sign in to comment.