diff options
Diffstat (limited to 'src/io/io_worker.rs')
-rw-r--r-- | src/io/io_worker.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/io/io_worker.rs b/src/io/io_worker.rs index 42a3ef5..b8d5113 100644 --- a/src/io/io_worker.rs +++ b/src/io/io_worker.rs @@ -200,11 +200,17 @@ impl IoWorkerThread { total_bytes, total_bytes, ); + #[cfg(feature = "recycle_bin")] if self.options.permanently { remove_files(&self.paths)?; } else { trash_files(&self.paths)?; } + #[cfg(not(feature = "recycle_bin"))] + { + remove_files(&self.paths)?; + } + Ok(progress) } } @@ -323,6 +329,7 @@ pub fn recursive_cut( } } +#[cfg(feature = "recycle_bin")] fn trash_error_to_io_error(err: trash::Error) -> std::io::Error { match err { trash::Error::Unknown { description } => { @@ -351,6 +358,7 @@ where Ok(()) } +#[cfg(feature = "recycle_bin")] fn trash_files<P>(paths: &[P]) -> std::io::Result<()> where P: AsRef<path::Path>, |