mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:57:16 +00:00
perf(tauri-build): refactor find_icon to use &str to remove unnecessary clones
This commit is contained in:
parent
32576120fd
commit
544e1ba099
5
.changes/perf-tauri-build-string.md
Normal file
5
.changes/perf-tauri-build-string.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-build": perf
|
||||
---
|
||||
|
||||
Refactor find_icon to use &str to remove unnecessary clones. No user facing changes.
|
||||
@ -57,7 +57,7 @@ fn copy_binaries(
|
||||
binaries: ResourcePaths,
|
||||
target_triple: &str,
|
||||
path: &Path,
|
||||
package_name: Option<&String>,
|
||||
package_name: Option<&str>,
|
||||
) -> Result<()> {
|
||||
for src in binaries {
|
||||
let src = src?;
|
||||
@ -529,7 +529,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
ResourcePaths::new(&external_binaries(paths, &target_triple, &target), true),
|
||||
&target_triple,
|
||||
target_dir,
|
||||
manifest.package.as_ref().map(|p| &p.name),
|
||||
manifest.package.as_ref().map(|p| p.name.as_ref()),
|
||||
)?;
|
||||
}
|
||||
|
||||
@ -593,8 +593,8 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
.icon
|
||||
.iter()
|
||||
.find(|i| predicate(i))
|
||||
.cloned()
|
||||
.unwrap_or_else(|| default.to_string());
|
||||
.map(AsRef::as_ref)
|
||||
.unwrap_or_else(|| default);
|
||||
icon_path.into()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user