From ab4a4a89e6c45552bd754214d7a24487f7be0f95 Mon Sep 17 00:00:00 2001 From: dAxpeDDa Date: Sun, 11 Jun 2023 18:20:55 +0200 Subject: [PATCH] Remove unused `EventListenerOptions` --- Cargo.toml | 1 - src/platform_impl/web/web_sys/event_handle.rs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fc364dd1..859ba837 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -137,7 +137,6 @@ features = [ 'DomRect', 'Element', 'Event', - "EventListenerOptions", 'EventTarget', 'FocusEvent', 'HtmlCanvasElement', diff --git a/src/platform_impl/web/web_sys/event_handle.rs b/src/platform_impl/web/web_sys/event_handle.rs index 9f9be48a..505d58a2 100644 --- a/src/platform_impl/web/web_sys/event_handle.rs +++ b/src/platform_impl/web/web_sys/event_handle.rs @@ -1,11 +1,10 @@ use wasm_bindgen::{prelude::Closure, JsCast}; -use web_sys::{EventListenerOptions, EventTarget}; +use web_sys::EventTarget; pub struct EventListenerHandle { target: EventTarget, event_type: &'static str, listener: Closure, - options: EventListenerOptions, } impl EventListenerHandle { @@ -21,7 +20,6 @@ impl EventListenerHandle { target, event_type, listener, - options: EventListenerOptions::new(), } } } @@ -29,10 +27,9 @@ impl EventListenerHandle { impl Drop for EventListenerHandle { fn drop(&mut self) { self.target - .remove_event_listener_with_callback_and_event_listener_options( + .remove_event_listener_with_callback( self.event_type, self.listener.as_ref().unchecked_ref(), - &self.options, ) .unwrap_or_else(|e| { web_sys::console::error_2(