mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Remove unused EventListenerOptions
This commit is contained in:
parent
f7a400ddf6
commit
ab4a4a89e6
|
@ -137,7 +137,6 @@ features = [
|
||||||
'DomRect',
|
'DomRect',
|
||||||
'Element',
|
'Element',
|
||||||
'Event',
|
'Event',
|
||||||
"EventListenerOptions",
|
|
||||||
'EventTarget',
|
'EventTarget',
|
||||||
'FocusEvent',
|
'FocusEvent',
|
||||||
'HtmlCanvasElement',
|
'HtmlCanvasElement',
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue