From f22eecdd3b7addb9b20ec4510106c6ee339d215e Mon Sep 17 00:00:00 2001 From: Jeff Zhao Date: Wed, 8 Jun 2022 12:01:36 -0400 Subject: update dependencies --- src/commands/delete_files.rs | 11 +++-------- src/error/error_type.rs | 11 ++--------- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/commands/delete_files.rs b/src/commands/delete_files.rs index e5ef734..126346f 100644 --- a/src/commands/delete_files.rs +++ b/src/commands/delete_files.rs @@ -12,17 +12,12 @@ use super::reload; fn trash_error_to_io_error(err: trash::Error) -> std::io::Error { match err { - trash::Error::Unknown => std::io::Error::new(std::io::ErrorKind::Other, "Unknown Error"), + trash::Error::Unknown { description } => { + std::io::Error::new(std::io::ErrorKind::Other, description) + } trash::Error::TargetedRoot => { std::io::Error::new(std::io::ErrorKind::Other, "Targeted Root") } - trash::Error::CanonicalizePath { code: _ } => { - std::io::Error::new(std::io::ErrorKind::NotFound, "Not found") - } - trash::Error::Remove { code: Some(1) } => std::io::Error::new( - std::io::ErrorKind::InvalidData, - "Cannot move files to trash from mounted system", - ), _ => std::io::Error::new(std::io::ErrorKind::Other, "Unknown Error"), } } diff --git a/src/error/error_type.rs b/src/error/error_type.rs index d35b808..ef147b8 100644 --- a/src/error/error_type.rs +++ b/src/error/error_type.rs @@ -56,19 +56,12 @@ impl From for JoshutoError { impl From for JoshutoError { fn from(err: trash::Error) -> Self { let err = match err { - trash::Error::Unknown => { - std::io::Error::new(std::io::ErrorKind::Other, "Unknown Error") + trash::Error::Unknown { description } => { + std::io::Error::new(std::io::ErrorKind::Other, description) } trash::Error::TargetedRoot => { std::io::Error::new(std::io::ErrorKind::Other, "Targeted Root") } - trash::Error::CanonicalizePath { code: _ } => { - std::io::Error::new(std::io::ErrorKind::NotFound, "Not found") - } - trash::Error::Remove { code: Some(1) } => std::io::Error::new( - std::io::ErrorKind::InvalidData, - "Cannot move files to trash from mounted system", - ), _ => std::io::Error::new(std::io::ErrorKind::Other, "Unknown Error"), }; Self { -- cgit v1.2.3