summary history branches tags files
commit:71175c2d72013195c18c67315e1eda4152e1509f
author:Trevor Bentley
committer:Trevor Bentley
date:Mon Apr 2 13:13:01 2018 +0200
parents:0a371064e04fae1b5a1e2ce2a76f83c9ff6be818
Specify return type for all msg_send calls
diff --git a/src/osx.rs b/src/osx.rs
line changes: +9/-9
index 1e924e1..93a0034
--- a/src/osx.rs
+++ b/src/osx.rs
@@ -403,7 +403,7 @@ impl Trampoline {
                                            initWithBytes:app.as_ptr()
                                            length:app.len()
                                            encoding: 4]; // UTF8_ENCODING
-            msg_send![wspace, launchApplication: s];
+            let _:() = msg_send![wspace, launchApplication: s];
 
             // Note: launchedApplication doesn't return until the child process
             // calls [NSApplication sharedApplication].
@@ -457,7 +457,7 @@ impl FruitApp {
             ActivationPolicy::Prohibited => 2,
         };
         unsafe {
-            msg_send![self.app, setActivationPolicy: policy_int];
+            let _:() = msg_send![self.app, setActivationPolicy: policy_int];
         }
     }
 
@@ -480,7 +480,7 @@ impl FruitApp {
         unsafe {
             let cls = objc::runtime::Class::get("NSApplication").unwrap();
             let app: *mut objc::runtime::Object = msg_send![cls, sharedApplication];
-            let _ = msg_send![app, terminate: exit_code];
+            let _:() = msg_send![app, terminate: exit_code];
         }
     }
 
@@ -525,13 +525,13 @@ impl FruitApp {
             unsafe {
                 let run_count = self.run_count.get();
                 if run_count == 0 {
-                    let _ = msg_send![self.app, finishLaunching];
+                    let _:() = msg_send![self.app, finishLaunching];
                 }
                 // Create a new release pool every once in a while, draining the old one
                 if run_count % 100 == 0 {
                     let old_pool = self.pool.get();
                     if run_count != 0 {
-                        let _ = msg_send![old_pool, drain];
+                        let _:() = msg_send![old_pool, drain];
                     }
                     let cls = Class::get("NSAutoreleasePool").unwrap();
                     let pool: *mut Object = msg_send![cls, alloc];
@@ -544,8 +544,8 @@ impl FruitApp {
                                                    untilDate: nil
                                                    inMode: mode
                                                    dequeue: 1];
-                let _ = msg_send![self.app, sendEvent: event];
-                let _ = msg_send![self.app, updateWindows];
+                let _:() = msg_send![self.app, sendEvent: event];
+                let _:() = msg_send![self.app, updateWindows];
                 self.run_count.set(run_count + 1);
             }
             if period == RunPeriod::Once {
@@ -615,8 +615,8 @@ impl FruitApp {
             let ini: *mut Object = msg_send![bundle,
                                              pathForResource:objc_name
                                              ofType:objc_ext];
-            let _ = msg_send![objc_name, release];
-            let _ = msg_send![objc_ext, release];
+            let _:() = msg_send![objc_name, release];
+            let _:() = msg_send![objc_ext, release];
             let cstr: *const i8 = msg_send![ini, UTF8String];
             if cstr != std::ptr::null() {
                 let rstr = std::ffi::CStr::from_ptr(cstr).to_string_lossy().into_owned();