Skip to content

Commit

Permalink
Fixing feature clippy. (#114)
Browse files Browse the repository at this point in the history
* Fixing feature clippy.

* Remove duplicate CI.

* Missing repr(C).

* Make clippy happy on macos.
  • Loading branch information
Narsil committed Sep 25, 2023
1 parent ba33932 commit 5b8d412
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: build

on: [push, pull_request]
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub use crate::macos::grab as _grab;
#[cfg(feature = "unstable_grab")]
#[cfg(target_os = "windows")]
pub use crate::windows::grab as _grab;
#[cfg(any(feature = "unstable_grab"))]
#[cfg(feature = "unstable_grab")]
/// Grabbing global events. In the callback, returning None ignores the event
/// and returning the event let's it pass. There is no modification of the event
/// possible here.
Expand All @@ -356,7 +356,7 @@ pub use crate::windows::grab as _grab;
/// }
/// }
/// ```
#[cfg(any(feature = "unstable_grab"))]
#[cfg(feature = "unstable_grab")]
pub fn grab<T>(callback: T) -> Result<(), GrabError>
where
T: Fn(Event) -> Option<Event> + 'static,
Expand Down
5 changes: 5 additions & 0 deletions src/macos/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ extern "C" {
pub static kCFRunLoopCommonModes: CFRunLoopMode;

}

// TODO Remove this, this was added as the coded
// existed and worked, but clippy is complaining.
// There's probably a better fix.
#[allow(improper_ctypes_definitions)]
pub type QCallback = unsafe extern "C" fn(
proxy: CGEventTapProxy,
_type: CGEventType,
Expand Down

0 comments on commit 5b8d412

Please sign in to comment.