fixed downcasting for widgets and scene nodes

- removed a bunch of unnecessary casts to &dyn Reflect
This commit is contained in:
Dmitry Stepanov
2026-05-22 20:31:20 +03:00
parent d821684037
commit bee807ea17
11 changed files with 27 additions and 19 deletions
+2 -2
View File
@@ -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()
}
}