Remove unused EventListenerOptions

This commit is contained in:
dAxpeDDa 2023-06-11 18:20:55 +02:00 committed by daxpedda
parent f7a400ddf6
commit ab4a4a89e6
2 changed files with 2 additions and 6 deletions

View file

@ -137,7 +137,6 @@ features = [
'DomRect', 'DomRect',
'Element', 'Element',
'Event', 'Event',
"EventListenerOptions",
'EventTarget', 'EventTarget',
'FocusEvent', 'FocusEvent',
'HtmlCanvasElement', 'HtmlCanvasElement',

View file

@ -1,11 +1,10 @@
use wasm_bindgen::{prelude::Closure, JsCast}; use wasm_bindgen::{prelude::Closure, JsCast};
use web_sys::{EventListenerOptions, EventTarget}; use web_sys::EventTarget;
pub struct EventListenerHandle<T: ?Sized> { pub struct EventListenerHandle<T: ?Sized> {
target: EventTarget, target: EventTarget,
event_type: &'static str, event_type: &'static str,
listener: Closure<T>, listener: Closure<T>,
options: EventListenerOptions,
} }
impl<T: ?Sized> EventListenerHandle<T> { impl<T: ?Sized> EventListenerHandle<T> {
@ -21,7 +20,6 @@ impl<T: ?Sized> EventListenerHandle<T> {
target, target,
event_type, event_type,
listener, listener,
options: EventListenerOptions::new(),
} }
} }
} }
@ -29,10 +27,9 @@ impl<T: ?Sized> EventListenerHandle<T> {
impl<T: ?Sized> Drop for EventListenerHandle<T> { impl<T: ?Sized> Drop for EventListenerHandle<T> {
fn drop(&mut self) { fn drop(&mut self) {
self.target self.target
.remove_event_listener_with_callback_and_event_listener_options( .remove_event_listener_with_callback(
self.event_type, self.event_type,
self.listener.as_ref().unchecked_ref(), self.listener.as_ref().unchecked_ref(),
&self.options,
) )
.unwrap_or_else(|e| { .unwrap_or_else(|e| {
web_sys::console::error_2( web_sys::console::error_2(