Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
blm768 committed Jun 8, 2019
1 parent ba0fbd2 commit fe963e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ extern crate winit;
#[macro_use]
extern crate stdweb;
#[cfg(feature = "wasm-bindgen")]
#[macro_use]
extern crate wasm_bindgen;
#[cfg(feature = "wasm-bindgen")]
extern crate web_sys;
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/web_sys/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/web_sys/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fe963e4

Please sign in to comment.