fix: explicit default for event handler
rust derives default of T: Default, even when that's not a necessary requirement
This fixes that
@@ -351,11 +351,18 @@ type ExternalListenerCallback<'bump, T> = BumpBox<'bump, dyn FnMut(T) + 'bump>;
/// }
///
/// ```
-#[derive(Default)]
pub struct EventHandler<'bump, T = ()> {
pub callback: RefCell<Option<ExternalListenerCallback<'bump, T>>>,
}
+impl<'a> Default for EventHandler<'a> {
+ fn default() -> Self {
+ Self {
+ callback: RefCell::new(None),
+ }
+ }
+}
+
impl<T> EventHandler<'_, T> {
/// Call this event handler with the appropriate event type
pub fn call(&self, event: T) {
