From 74dddc880d451b879dd43beae087c7ffa643a377 Mon Sep 17 00:00:00 2001 From: jdvr Date: Sat, 19 Oct 2019 12:25:48 +0200 Subject: [PATCH] "#194 Added trash switch checked before normal rm command action" --- src/shell/filesystem_shell.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/shell/filesystem_shell.rs b/src/shell/filesystem_shell.rs index 3cf9afab21..a7d6a42248 100644 --- a/src/shell/filesystem_shell.rs +++ b/src/shell/filesystem_shell.rs @@ -944,14 +944,12 @@ impl Shell for FilesystemShell { )); } - if path.is_dir() { + if trash.item { + SendToTrash::remove(path).unwrap(); + } else if path.is_dir() { std::fs::remove_dir_all(&path)?; } else if path.is_file() { - if trash.item { - SendToTrash::remove(path).unwrap(); - } else { - std::fs::remove_file(&path)?; - } + std::fs::remove_file(&path)?; } } Err(e) => {