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',
'Element',
'Event',
"EventListenerOptions",
'EventTarget',
'FocusEvent',
'HtmlCanvasElement',

View file

@ -1,11 +1,10 @@
use wasm_bindgen::{prelude::Closure, JsCast};
use web_sys::{EventListenerOptions, EventTarget};
use web_sys::EventTarget;
pub struct EventListenerHandle<T: ?Sized> {
target: EventTarget,
event_type: &'static str,
listener: Closure<T>,
options: EventListenerOptions,
}
impl<T: ?Sized> EventListenerHandle<T> {
@ -21,7 +20,6 @@ impl<T: ?Sized> EventListenerHandle<T> {
target,
event_type,
listener,
options: EventListenerOptions::new(),
}
}
}
@ -29,10 +27,9 @@ impl<T: ?Sized> EventListenerHandle<T> {
impl<T: ?Sized> Drop for EventListenerHandle<T> {
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(