mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Fix some warnings
This commit is contained in:
parent
91a511ba8c
commit
7de1261555
|
@ -3,7 +3,6 @@ extern crate winit;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate stdweb;
|
extern crate stdweb;
|
||||||
#[cfg(feature = "wasm-bindgen")]
|
#[cfg(feature = "wasm-bindgen")]
|
||||||
#[macro_use]
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
#[cfg(feature = "wasm-bindgen")]
|
#[cfg(feature = "wasm-bindgen")]
|
||||||
extern crate web_sys;
|
extern crate web_sys;
|
||||||
|
|
|
@ -265,7 +265,7 @@ fn add_event<T: 'static, E, F>(
|
||||||
event_ref.cancel_bubble();
|
event_ref.cancel_bubble();
|
||||||
|
|
||||||
handler(&elrs, event);
|
handler(&elrs, event);
|
||||||
}) as Box<FnMut(E)>);
|
}) as Box<dyn FnMut(E)>);
|
||||||
|
|
||||||
target.add_event_listener_with_callback(event, &closure.as_ref().unchecked_ref());
|
target.add_event_listener_with_callback(event, &closure.as_ref().unchecked_ref());
|
||||||
closure.forget(); // TODO: don't leak this.
|
closure.forget(); // TODO: don't leak this.
|
||||||
|
|
|
@ -62,7 +62,7 @@ impl Window {
|
||||||
let canvas: HtmlCanvasElement = element.unchecked_into();
|
let canvas: HtmlCanvasElement = element.unchecked_into();
|
||||||
document().body()
|
document().body()
|
||||||
.ok_or_else(|| os_error!(OsError("Failed to find body node".to_owned())))?
|
.ok_or_else(|| os_error!(OsError("Failed to find body node".to_owned())))?
|
||||||
.append_child(&canvas);
|
.append_child(&canvas).map_err(|_| os_error!(OsError("Failed to append canvas".to_owned())))?;
|
||||||
|
|
||||||
register(&target.runner, &canvas);
|
register(&target.runner, &canvas);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue