Skip to content

Commit 7bbba26

Browse files
committed
Fixing a few clippy issues.
1 parent 1048572 commit 7bbba26

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ pub use crate::windows::grab as _grab;
356356
/// }
357357
/// }
358358
/// ```
359-
#[cfg(feature = "unstable_grab")]
360359
pub fn grab<T>(callback: T) -> Result<(), GrabError>
361360
where
362361
T: Fn(Event) -> Option<Event> + 'static,

src/windows/grab.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ unsafe extern "system" fn raw_callback(code: i32, param: usize, lpdata: isize) -
2222
time: SystemTime::now(),
2323
name,
2424
};
25-
if let Some(callback) = &mut GLOBAL_CALLBACK {
25+
let ptr = &raw mut GLOBAL_CALLBACK;
26+
if let Some(callback) = &mut *ptr {
2627
if callback(event).is_none() {
2728
// https://stackoverflow.com/questions/42756284/blocking-windows-mouse-click-using-setwindowshookex
2829
// https://android.developreference.com/article/14560004/Blocking+windows+mouse+click+using+SetWindowsHookEx()

src/windows/listen.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ unsafe extern "system" fn raw_callback(code: c_int, param: WPARAM, lpdata: LPARA
3333
time: SystemTime::now(),
3434
name,
3535
};
36-
if let Some(callback) = &mut GLOBAL_CALLBACK {
36+
let ptr = &raw mut GLOBAL_CALLBACK;
37+
if let Some(callback) = &mut *ptr {
3738
callback(event);
3839
}
3940
}

0 commit comments

Comments
 (0)