From fc08da7a8842082ba9bcdd85485eb608230fa74c Mon Sep 17 00:00:00 2001 From: xXxSuShIkiTtY420xXx <92689079+xXxSuShIkiTtY420xXx@users.noreply.github.com> Date: Sun, 17 Oct 2021 12:21:11 -0700 Subject: [PATCH] to_string? --- czkawka_gui/src/connect_button_delete.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/czkawka_gui/src/connect_button_delete.rs b/czkawka_gui/src/connect_button_delete.rs index 42fb122..4fbb216 100644 --- a/czkawka_gui/src/connect_button_delete.rs +++ b/czkawka_gui/src/connect_button_delete.rs @@ -364,10 +364,10 @@ pub fn empty_folder_remover(tree_view: >k::TreeView, column_file_name: i32, co } } - let full_path = format!("{}/{}", path, name); + let full_path = format!("{}/{}", path, name).to_string(); #[cfg(target_family = "windows")] - let full_path = format!("{}/{}", path, name).replace("/", "\\"); + let full_path = full_path.replace("/", "\\"); if !error_happened { if !use_trash { @@ -386,6 +386,7 @@ pub fn empty_folder_remover(tree_view: >k::TreeView, column_file_name: i32, co } } } + if error_happened { messages += format!("Failed to remove folder {} because folder doesn't exists, you don't have permissions or isn't empty.\n", full_path).as_str() } @@ -423,10 +424,10 @@ pub fn basic_remove(tree_view: >k::TreeView, column_file_name: i32, column_pat let name = model.value(&iter, column_file_name).get::().unwrap(); let path = model.value(&iter, column_path).get::().unwrap(); - let full_path = format!("{}/{}", path, name); + let full_path = format!("{}/{}", path, name).to_string(); #[cfg(target_family = "windows")] - let full_path = format!("{}/{}", path, name).replace("/", "\\"); + let full_path = full_path.replace("/", "\\"); if !use_trash { match fs::remove_file(full_path) { @@ -495,10 +496,10 @@ pub fn tree_remove(tree_view: >k::TreeView, column_file_name: i32, column_path vec_file_name.sort(); vec_file_name.dedup(); for file_name in vec_file_name { - let full_path = format!("{}/{}", path.clone(), file_name.clone()); + let full_path = format!("{}/{}", path.clone(), file_name.clone()).to_string(); #[cfg(target_family = "windows")] - let full_path = format!("{}/{}", path.clone(), file_name.clone()).replace("/", "\\"); + let full_path = full_path.replace("/", "\\"); if !use_trash { if fs::remove_file(full_path).is_err() {