From fc0b0f02a16c38dc4744bf7a1264a5cc62088269 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 20 Jan 2024 11:21:49 -0800 Subject: [PATCH] downcast data with panic --- packages/core/src/nodes.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 7dc56f2d2..2cb1a0a4b 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -696,12 +696,13 @@ impl AttributeValue { /// The callback must be confined to the lifetime of the ScopeState pub fn listener(mut callback: impl FnMut(Event) + 'static) -> AttributeValue { AttributeValue::Listener(EventHandler::new(move |event: Event| { - if let Ok(data) = event.data.downcast::() { - callback(Event { - propagates: event.propagates, - data, - }); - } + let data = event.data.downcast::().unwrap(); + // if let Ok(data) = event.data.downcast::() { + callback(Event { + propagates: event.propagates, + data, + }); + // } })) }