diff --git a/src/appkit/app/enums.rs b/src/appkit/app/enums.rs index 140515cc..5ea29b11 100644 --- a/src/appkit/app/enums.rs +++ b/src/appkit/app/enums.rs @@ -1,4 +1,5 @@ //! Various types used at the AppController level. +#![allow(unused_parens)] use crate::foundation::NSUInteger; diff --git a/src/foundation/urls/mod.rs b/src/foundation/urls/mod.rs index 3f1e4a50..7399fb5f 100644 --- a/src/foundation/urls/mod.rs +++ b/src/foundation/urls/mod.rs @@ -90,7 +90,7 @@ impl<'a> NSURL<'a> { pub fn bookmark_data( &self, options: &[NSURLBookmarkCreationOption], - resource_value_keys: &[NSURLResourceKey], + _resource_value_keys: &[NSURLResourceKey], relative_to_url: Option ) -> Result> { let mut opts: NSUInteger = 0; @@ -133,10 +133,10 @@ impl<'a> NSURL<'a> { /// Converts bookmark data into a URL. pub fn from_bookmark_data( - data: NSData, - options: &[NSURLBookmarkResolutionOption], - relative_to_url: Option, - data_is_stale: bool + _data: NSData, + _options: &[NSURLBookmarkResolutionOption], + _relative_to_url: Option, + _data_is_stale: bool ) -> Result> { Err("LOL".into()) } diff --git a/src/image/image.rs b/src/image/image.rs index e33612a5..b03a78ec 100644 --- a/src/image/image.rs +++ b/src/image/image.rs @@ -290,11 +290,11 @@ impl Image { #[test] fn test_image_from_bytes() { let image_bytes = include_bytes!("../../test-data/favicon.ico"); - let image = Image::with_data(image_bytes); + let _image = Image::with_data(image_bytes); } // It's unclear where the file is on the ios simulator. #[test] #[cfg(target_os = "macos")] fn test_image_from_file() { - let image = Image::with_contents_of_file("./test-data/favicon.ico"); + let _image = Image::with_contents_of_file("./test-data/favicon.ico"); } diff --git a/src/image/uikit.rs b/src/image/uikit.rs index 3622298a..b8ea9652 100644 --- a/src/image/uikit.rs +++ b/src/image/uikit.rs @@ -18,7 +18,7 @@ pub(crate) fn register_image_view_class() -> &'static Class { INIT.call_once(|| unsafe { let superclass = class!(UIImageView); - let mut decl = ClassBuilder::new("RSTImageView", superclass).expect("Failed to get RSTVIEW"); + let decl = ClassBuilder::new("RSTImageView", superclass).expect("Failed to get RSTVIEW"); VIEW_CLASS = Some(decl.register()); }); diff --git a/src/uikit/app/delegate.rs b/src/uikit/app/delegate.rs index bfc5eeaa..cd19a1b9 100644 --- a/src/uikit/app/delegate.rs +++ b/src/uikit/app/delegate.rs @@ -26,7 +26,7 @@ use crate::cloudkit::share::CKShareMetaData; /// A handy method for grabbing our `AppDelegate` from the pointer. This is different from our /// standard `utils` version as this doesn't require `RefCell` backing. -fn app(this: &Object) -> &T { +fn app(_this: &Object) -> &T { unsafe { //let app_ptr: usize = *this.ivar(APP_DELEGATE); let app = APP_DELEGATE as *const T; diff --git a/src/uikit/app/mod.rs b/src/uikit/app/mod.rs index f6b7dda4..dc5628c9 100644 --- a/src/uikit/app/mod.rs +++ b/src/uikit/app/mod.rs @@ -115,9 +115,9 @@ where activate_cocoa_multithreading(); let pool = AutoReleasePool::new(); - let cls = register_app_class(); - let dl = register_app_delegate_class::(); - let w = register_window_scene_delegate_class::(); + let _cls = register_app_class(); + let _dl = register_app_delegate_class::(); + let _w = register_window_scene_delegate_class::(); let app_delegate = Box::new(delegate); let vendor = Box::new(scene_delegate_vendor); @@ -149,8 +149,8 @@ impl App { let c_args = args.iter().map(|arg| arg.as_ptr()).collect::>(); - let mut s = NSString::new("RSTApplication"); - let mut s2 = NSString::new("RSTAppDelegate"); + let s = NSString::new("RSTApplication"); + let s2 = NSString::new("RSTAppDelegate"); unsafe { UIApplicationMain(c_args.len() as c_int, c_args.as_ptr(), s.into(), s2.into()); diff --git a/src/view/mod.rs b/src/view/mod.rs index b280790b..bf90638f 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -168,6 +168,7 @@ impl View { /// This handles grabbing autolayout anchor pointers, as well as things related to layering and /// so on. It returns a generic `View`, which the caller can then customize as needed. pub(crate) fn init(view: id) -> View { + #[allow(unused_unsafe)] unsafe { #[cfg(feature = "autolayout")] let _: () = msg_send![view, setTranslatesAutoresizingMaskIntoConstraints: false]; diff --git a/src/view/uikit.rs b/src/view/uikit.rs index 4bd2228a..2114e696 100644 --- a/src/view/uikit.rs +++ b/src/view/uikit.rs @@ -19,7 +19,7 @@ pub(crate) fn register_view_class() -> &'static Class { INIT.call_once(|| unsafe { let superclass = class!(UIView); - let mut decl = ClassBuilder::new("RSTView", superclass).unwrap(); + let decl = ClassBuilder::new("RSTView", superclass).unwrap(); VIEW_CLASS = Some(decl.register()); }); @@ -29,7 +29,7 @@ pub(crate) fn register_view_class() -> &'static Class { /// Injects a `UIView` subclass, with some callback and pointer ivars for what we /// need to do. pub(crate) fn register_view_class_with_delegate(instance: &T) -> &'static Class { - load_or_register_class("UIView", instance.subclass_name(), |decl| unsafe { + load_or_register_class("UIView", instance.subclass_name(), |decl| { decl.add_ivar::(VIEW_DELEGATE_PTR); }) } diff --git a/src/webview/mod.rs b/src/webview/mod.rs index e909aa72..55efabc9 100644 --- a/src/webview/mod.rs +++ b/src/webview/mod.rs @@ -242,7 +242,7 @@ where let view = allocate_webview(config, Some(&objc_delegate)); let mut view = WebView::init(view); - &delegate.did_load(view.clone_as_handle()); + delegate.did_load(view.clone_as_handle()); view.delegate = Some(delegate); view }