diff options
Diffstat (limited to 'src/io/io_worker.rs')
-rw-r--r-- | src/io/io_worker.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/io/io_worker.rs b/src/io/io_worker.rs index 42a3ef5..3be08e6 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,7 +329,8 @@ pub fn recursive_cut( } } -fn trash_error_to_io_error(err: trash::Error) -> std::io::Error { +#[cfg(feature = "recycle_bin")] +fn trash_error_to_io_error(err: ::Error) -> std::io::Error { match err { trash::Error::Unknown { description } => { std::io::Error::new(std::io::ErrorKind::Other, 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>, |