Pārlūkot izejas kodu

chore(codegen): remove dead code on macOS (#3630)

Lucas Fernandes Nogueira 3 gadi atpakaļ
vecāks
revīzija
06ab85b469

+ 1 - 1
core/tauri-codegen/Cargo.toml

@@ -30,7 +30,7 @@ uuid = { version = "0.8", features = [ "v4" ] }
 [target."cfg(windows)".dependencies]
 ico = "0.1"
 
-[target."cfg(not(windows))".dependencies]
+[target."cfg(target_os = \"linux\")".dependencies]
 png = "0.16"
 
 [features]

+ 2 - 1
core/tauri-codegen/src/context.rs

@@ -360,7 +360,7 @@ fn ico_icon<P: AsRef<Path>>(root: &TokenStream, path: P) -> TokenStream {
   quote!(Some(#root::Icon::Rgba { rgba: vec![#(#rgba_items),*], width: #width, height: #height }))
 }
 
-#[cfg(not(windows))]
+#[cfg(target_os = "linux")]
 fn png_icon<P: AsRef<Path>>(root: &TokenStream, path: P) -> TokenStream {
   let path = path.as_ref();
   let bytes = std::fs::read(&path)
@@ -380,6 +380,7 @@ fn png_icon<P: AsRef<Path>>(root: &TokenStream, path: P) -> TokenStream {
   quote!(Some(#root::Icon::Rgba { rgba: vec![#(#rgba_items),*], width: #width, height: #height }))
 }
 
+#[cfg(any(windows, target_os = "linux"))]
 fn find_icon<F: Fn(&&String) -> bool>(
   config: &Config,
   config_parent: &Path,

+ 1 - 0
core/tauri/src/manager.rs

@@ -126,6 +126,7 @@ fn set_csp<R: Runtime>(
     default_src.push(format_real_schema(schema));
   }
 
+  #[allow(clippy::let_and_return)]
   let csp = Csp::DirectiveMap(csp).to_string();
   #[cfg(target_os = "linux")]
   {