Skip to content

Commit 475bd5f

Browse files
committed
remove unneeded allocation
1 parent 1274b1c commit 475bd5f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/win/window.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ unsafe fn wnd_proc_inner(
182182
if *mouse_was_outside_window {
183183
// this makes Windows track whether the mouse leaves the window.
184184
// When the mouse leaves it results in a `WM_MOUSELEAVE` event.
185-
let track_mouse = Rc::new(TRACKMOUSEEVENT {
185+
let mut track_mouse =TRACKMOUSEEVENT {
186186
cbSize: std::mem::size_of::<TRACKMOUSEEVENT>() as u32,
187187
dwFlags: winapi::um::winuser::TME_LEAVE,
188188
hwndTrack: hwnd,
189189
dwHoverTime: winapi::um::winuser::HOVER_DEFAULT,
190-
});
190+
};
191191
// Couldn't find a good way to track whether the mouse enters,
192192
// but if `WM_MOUSEMOVE` happens, the mouse must have entered.
193-
TrackMouseEvent(Rc::as_ptr(&track_mouse) as winapi::um::winuser::LPTRACKMOUSEEVENT);
193+
TrackMouseEvent(&mut track_mouse);
194194
*mouse_was_outside_window = false;
195195

196196
let enter_event = Event::Mouse(MouseEvent::CursorEntered);

0 commit comments

Comments
 (0)