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 103143f3..b63c3cd3 100644 --- a/src/foundation/urls/mod.rs +++ b/src/foundation/urls/mod.rs @@ -82,7 +82,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; @@ -125,10 +125,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 45e7b84a..3fe99479 100644 --- a/src/image/image.rs +++ b/src/image/image.rs @@ -299,11 +299,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 1893abd1..8b02960e 100644 --- a/src/image/uikit.rs +++ b/src/image/uikit.rs @@ -6,5 +6,5 @@ use crate::foundation::load_or_register_class; /// have separate classes here since we don't want to waste cycles on methods that will never be /// used if there's no delegates. pub(crate) fn register_image_view_class() -> &'static Class { - load_or_register_class("UIImageView", "RSTImageView", |decl| unsafe {}) + load_or_register_class("UIImageView", "RSTImageView", |decl| {}) } diff --git a/src/uikit/app/delegate.rs b/src/uikit/app/delegate.rs index fa236f22..420c1391 100644 --- a/src/uikit/app/delegate.rs +++ b/src/uikit/app/delegate.rs @@ -19,7 +19,7 @@ use crate::uikit::scene::{SceneConnectionOptions, SceneSession}; /// 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 00907639..9da6d815 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); diff --git a/src/view/mod.rs b/src/view/mod.rs index 64aec95e..529f0748 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -172,6 +172,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 a4840568..5c683fa4 100644 --- a/src/view/uikit.rs +++ b/src/view/uikit.rs @@ -11,13 +11,13 @@ use crate::view::{ViewDelegate, VIEW_DELEGATE_PTR}; /// have separate classes here since we don't want to waste cycles on methods that will never be /// used if there's no delegates. pub(crate) fn register_view_class() -> &'static Class { - load_or_register_class("UIView", "RSTView", |decl| unsafe {}) + load_or_register_class("UIView", "RSTView", |decl| {}) } /// 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 11cf391c..41500e0f 100644 --- a/src/webview/mod.rs +++ b/src/webview/mod.rs @@ -241,7 +241,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 }