浏览代码

Different approach to cfg

Jonathan Kelley 1 年之前
父节点
当前提交
ac64f40842
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/desktop/src/menubar.rs

+ 3 - 1
packages/desktop/src/menubar.rs

@@ -4,9 +4,11 @@ use tao::window::Window;
 
 #[allow(unused)]
 pub fn build_menu(window: &Window, default_menu_bar: bool) -> Option<Box<dyn Any>> {
+    #[allow(unused_mut)]
     let mut menu = None;
 
-    if 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>);
     }