mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:37:09 +00:00
refactor(context): simplify predicate in find_icon to accept &&String
This commit is contained in:
parent
6bdbac3e04
commit
0fe1cf2568
@ -493,14 +493,14 @@ pub fn context_codegen(data: ContextData) -> EmbeddedAssetsResult<TokenStream> {
|
||||
fn find_icon(
|
||||
config: &Config,
|
||||
config_parent: &Path,
|
||||
predicate: impl Fn(&str) -> bool,
|
||||
predicate: impl Fn(&&String) -> bool,
|
||||
default: &str,
|
||||
) -> PathBuf {
|
||||
let icon_path = config
|
||||
.bundle
|
||||
.icon
|
||||
.iter()
|
||||
.find(|i| predicate(i))
|
||||
.find(predicate)
|
||||
.map(AsRef::as_ref)
|
||||
.unwrap_or(default);
|
||||
config_parent.join(icon_path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user