Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 4, 2022
1 parent fe2b011 commit 754075f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/platform_impl/web/event_loop/window_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ impl<T> EventLoopWindowTarget<T> {
canvas.on_touch_end(prevent_default);

let runner = self.runner.clone();
let has_focus_clone = has_focus.clone();
let has_focus = has_focus.clone();
canvas.on_blur(move || {
*has_focus_clone.borrow_mut() = false;
*has_focus.borrow_mut() = false;
runner.send_event(Event::WindowEvent {
window_id: RootWindowId(id),
event: WindowEvent::Focused(false),
});
});

let runner = self.runner.clone();
let has_focus_clone = has_focus.clone();
let has_focus = has_focus.clone();
canvas.on_focus(move || {
*has_focus_clone.borrow_mut() = true;
*has_focus.borrow_mut() = true;
runner.send_event(Event::WindowEvent {
window_id: RootWindowId(id),
event: WindowEvent::Focused(true),
Expand Down Expand Up @@ -181,9 +181,8 @@ impl<T> EventLoopWindowTarget<T> {
);

let runner = self.runner.clone();
let has_focus_clone = has_focus.clone();
canvas.on_mouse_press(move |pointer_id, position, button, modifiers| {
*has_focus_clone.borrow_mut() = true;
*has_focus.borrow_mut() = true;
// A mouse down event may come in without any prior CursorMoved events,
// therefore we should send a CursorMoved event to make sure that the
// user code has the correct cursor position.
Expand Down

0 comments on commit 754075f

Please sign in to comment.