Skip to content

Commit

Permalink
chore(codegen): remove dead code on macOS (#3630)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Mar 7, 2022
1 parent 9c65abc commit 06ab85b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/tauri-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion core/tauri-codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions core/tauri/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
{
Expand Down

0 comments on commit 06ab85b

Please sign in to comment.