mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
fixed downcasting for widgets and scene nodes
- removed a bunch of unnecessary casts to &dyn Reflect
This commit is contained in:
@@ -270,11 +270,11 @@ pub trait NodeTrait: BaseNodeTrait + Reflect + Visit {
|
||||
// See ObjectOrVariantHelper for the cause of the indirection.
|
||||
impl<T: NodeTrait> ObjectOrVariantHelper<Node, T> for PhantomData<T> {
|
||||
fn convert_to_dest_type_helper(node: &Node) -> Option<&T> {
|
||||
(node.0.deref() as &dyn Reflect).self_or_field_ref()
|
||||
node.inner_ref().self_or_field_ref()
|
||||
}
|
||||
|
||||
fn convert_to_dest_type_helper_mut(node: &mut Node) -> Option<&mut T> {
|
||||
(node.0.deref_mut() as &mut dyn Reflect).self_or_field_mut()
|
||||
node.inner_mut().self_or_field_mut()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user