Skip to content

Commit 5b8d412

Browse files
authored
Fixing feature clippy. (#114)
* Fixing feature clippy. * Remove duplicate CI. * Missing repr(C). * Make clippy happy on macos.
1 parent ba33932 commit 5b8d412

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
49

510
jobs:
611
build:

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub use crate::macos::grab as _grab;
330330
#[cfg(feature = "unstable_grab")]
331331
#[cfg(target_os = "windows")]
332332
pub use crate::windows::grab as _grab;
333-
#[cfg(any(feature = "unstable_grab"))]
333+
#[cfg(feature = "unstable_grab")]
334334
/// Grabbing global events. In the callback, returning None ignores the event
335335
/// and returning the event let's it pass. There is no modification of the event
336336
/// possible here.
@@ -356,7 +356,7 @@ pub use crate::windows::grab as _grab;
356356
/// }
357357
/// }
358358
/// ```
359-
#[cfg(any(feature = "unstable_grab"))]
359+
#[cfg(feature = "unstable_grab")]
360360
pub fn grab<T>(callback: T) -> Result<(), GrabError>
361361
where
362362
T: Fn(Event) -> Option<Event> + 'static,

src/macos/common.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ extern "C" {
7979
pub static kCFRunLoopCommonModes: CFRunLoopMode;
8080

8181
}
82+
83+
// TODO Remove this, this was added as the coded
84+
// existed and worked, but clippy is complaining.
85+
// There's probably a better fix.
86+
#[allow(improper_ctypes_definitions)]
8287
pub type QCallback = unsafe extern "C" fn(
8388
proxy: CGEventTapProxy,
8489
_type: CGEventType,

0 commit comments

Comments
 (0)