Skip to content

Commit d1ac1f9

Browse files
committed
Make CGEventTap #[must_use]
This prevents a failure mode of handling the Result of CGEventTap::new() but not saving the tap itself.
1 parent 31a1edf commit d1ac1f9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core-graphics/src/event.rs

+1
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ unsafe extern "C" fn cg_event_tap_callback_internal(
567567
/// },
568568
/// ).expect("Failed to install event tap");
569569
/// ```
570+
#[must_use = "CGEventTap is disabled when dropped"]
570571
pub struct CGEventTap<'tap_life> {
571572
mach_port: CFMachPort,
572573
_callback: Box<CGEventTapCallbackFn<'tap_life>>,

0 commit comments

Comments
 (0)