From b2a9faa0d6499fce5a4a688b11d262d2ea804ef0 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Tue, 23 May 2023 23:24:16 -0300 Subject: [PATCH] reduce to_path_buf calls --- tooling/bundler/src/bundle/windows/nsis.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tooling/bundler/src/bundle/windows/nsis.rs b/tooling/bundler/src/bundle/windows/nsis.rs index 21b0cfa29da1..35da22787b0f 100644 --- a/tooling/bundler/src/bundle/windows/nsis.rs +++ b/tooling/bundler/src/bundle/windows/nsis.rs @@ -482,26 +482,25 @@ fn generate_resource_data(settings: &Settings) -> crate::Result { let resource = resource?; let src = cwd.join(resource.path()); - let resource_path = dunce::simplified(&src); + let resource_path = dunce::simplified(&src).to_path_buf(); // In some glob resource paths like `assets/**/*` a file might appear twice // because the `tauri_utils::resources::ResourcePaths` iterator also reads a directory // when it finds one. So we must check it before processing the file. - if added_resources.contains(&resource_path.to_path_buf()) { + if added_resources.contains(&resource_path) { continue; } - added_resources.push(resource_path.to_path_buf()); + added_resources.push(resource_path.clone()); let target_path = resource.target(); resources.insert( - resource_path.to_path_buf().clone(), + resource_path, ( target_path .parent() .expect("Couldn't get parent of target path") - .to_path_buf() - .clone(), - target_path.to_path_buf().clone(), + .to_path_buf(), + target_path.to_path_buf(), ), ); }