mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 15:13:13 -04:00
Fix some warnings
This commit is contained in:
@@ -265,7 +265,7 @@ fn add_event<T: 'static, E, F>(
|
||||
event_ref.cancel_bubble();
|
||||
|
||||
handler(&elrs, event);
|
||||
}) as Box<FnMut(E)>);
|
||||
}) as Box<dyn FnMut(E)>);
|
||||
|
||||
target.add_event_listener_with_callback(event, &closure.as_ref().unchecked_ref());
|
||||
closure.forget(); // TODO: don't leak this.
|
||||
|
||||
@@ -62,7 +62,7 @@ impl Window {
|
||||
let canvas: HtmlCanvasElement = element.unchecked_into();
|
||||
document().body()
|
||||
.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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user