Browse Source

Different approach to make clippy happy across platforms

Jonathan Kelley 1 năm trước cách đây
mục cha
commit
075caedf75
1 tập tin đã thay đổi với 2 bổ sung5 xóa
  1. 2 5
      packages/desktop/src/menubar.rs

+ 2 - 5
packages/desktop/src/menubar.rs

@@ -4,15 +4,12 @@ use tao::window::Window;
 
 
 #[allow(unused)]
 #[allow(unused)]
 pub fn build_menu(window: &Window, default_menu_bar: bool) -> Option<Box<dyn Any>> {
 pub fn build_menu(window: &Window, default_menu_bar: bool) -> Option<Box<dyn Any>> {
-    #[allow(unused_mut)]
-    let mut menu = None;
-
     #[cfg(not(any(target_os = "ios", target_os = "android")))]
     #[cfg(not(any(target_os = "ios", target_os = "android")))]
     {
     {
-        menu = Some(Box::new(impl_::build_menu_bar(default_menu_bar, window)) as Box<dyn Any>);
+        return Some(Box::new(impl_::build_menu_bar(default_menu_bar, window)) as Box<dyn Any>);
     }
     }
 
 
-    menu
+    None
 }
 }
 
 
 #[cfg(not(any(target_os = "ios", target_os = "android")))]
 #[cfg(not(any(target_os = "ios", target_os = "android")))]