Skip to content

Commit

Permalink
Removed the silly PlatformApi error
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturKovacs committed Apr 17, 2021
1 parent baa5171 commit 61fa667
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,6 @@ mod platform;
#[path = "macos.rs"]
mod platform;

/// Error that might happen during a trash operation.
// impl fmt::Display for Error {
// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// let intro = "Error during a `trash` operation:";
// if let Some(ref source) = self.source {
// write!(f, "{} ( {:?} ) Source was '{}'", intro, self.kind, source)
// } else {
// write!(f, "{} ( {:?} ) Source error is not specified.", intro, self.kind)
// }
// }
// }
// impl std::error::Error for Error {
// fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
// Some(self.source.as_ref()?.as_ref())
// }
// }
// impl Error {
// pub fn new(kind: ErrorKind, source: Box<dyn std::error::Error + 'static>) -> Error {
// Error { source: Some(source), kind }
// }
// pub fn kind_only(kind: ErrorKind) -> Error {
// Error { source: None, kind }
// }
// pub fn kind(&self) -> &ErrorKind {
// &self.kind
// }
// pub fn into_kind(self) -> ErrorKind {
// self.kind
// }
// pub fn into_source(self) -> Option<Box<dyn std::error::Error + 'static>> {
// self.source
// }
// /// Returns `Some` if the source is an `std::io::Error` error. Returns `None` otherwise.
// ///
// /// In other words this is a shorthand for
// /// `self.source().map(|x| x.downcast_ref::<std::io::Error>())`
// pub fn io_error_source(&self) -> Option<&std::io::Error> {
// self.source.as_ref()?.downcast_ref::<std::io::Error>()
// }
// }

///
/// A type that is contained within [`Error`]. It provides information about why the error was
/// produced. Some `ErrorKind` variants may promise that calling `source()`
Expand All @@ -105,18 +64,6 @@ pub enum Error {
target: String,
},

/// Any error that might happen during a direct call to a platform specific API.
///
/// `function_name`: the name of the function during which the error occured.
/// `code`: An error code that the function provided or was obtained otherwise.
///
/// On Windows the `code` will contain the HRESULT that the function returned or that was
/// obtained with `HRESULT_FROM_WIN32(GetLastError())`
PlatformApi {
function_name: &'static str,
code: Option<i32>,
},

/// Error while canonicalizing path.
///
/// The `source()` function of the `Error` will return a reference to an `std::io::Error`.
Expand Down

0 comments on commit 61fa667

Please sign in to comment.