diff --git a/Cargo.toml b/Cargo.toml index 1130c6d..2692d93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,9 +12,9 @@ repository = "https://github.com/rust-sysbar/rust-sysbar" [dependencies] [target.x86_64-apple-darwin.dependencies] -cocoa = "0.9" +cocoa = "0.20" objc = "0.2" -core-graphics = "0.8" +core-graphics = "0.19.0" objc-foundation = "0.1" objc_id = "0.1" libc = "0.2" diff --git a/src/mac_os/mod.rs b/src/mac_os/mod.rs index 719cb83..7f6b58a 100644 --- a/src/mac_os/mod.rs +++ b/src/mac_os/mod.rs @@ -48,8 +48,8 @@ impl MacOsSysbar { } } } - - pub fn add_item(&mut self, label: &str, cbs: Box ()>) { + #[allow(clippy::let_unit_value)] + pub fn add_item(&mut self, label: &str, cbs: Box ()>) { unsafe { let cb_obj = Callback::from(cbs); @@ -59,7 +59,11 @@ impl MacOsSysbar { let action = sel!(call); let item = NSMenuItem::alloc(nil) .initWithTitle_action_keyEquivalent_(itemtitle, action, no_key); - msg_send![item, setTarget: cb_obj]; + // Type inferance fails here, but we don't really + // care about the return values so assigning + // to _ with a () type annotation fixes a compile + // time error + let _: () = msg_send![item, setTarget: cb_obj]; NSMenu::addItem_(self.menu, item); }