summaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authordoug tangren <d.tangren@gmail.com>2018-10-10 13:55:57 -0400
committerGitHub <noreply@github.com>2018-10-10 13:55:57 -0400
commit92106b758e64ca1f9637272acea0eb83788df5b6 (patch)
treeaffb49322114498974e4e0dee9d24a5daf416461 /src/errors.rs
parent03c2ef7d8a873a7b15a2b6586cb428e5371ee6ef (diff)
fix a number of clippy warnings (#122)
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/errors.rs b/src/errors.rs
index b351309..5af8c44 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -3,7 +3,7 @@
use http;
use hyper::{self, StatusCode};
use serde_json::Error as SerdeError;
-use std::error::Error as ErrorTrait;
+use std::error::Error as StdError;
use std::fmt;
use std::io::Error as IoError;
@@ -47,25 +47,25 @@ impl fmt::Display for Error {
) -> fmt::Result {
write!(f, "Docker Error: ")?;
match self {
- &Error::SerdeJsonError(ref err) => return err.fmt(f),
- &Error::Http(ref err) => return err.fmt(f),
- &Error::Hyper(ref err) => return err.fmt(f),
- &Error::IO(ref err) => return err.fmt(f),
- &Error::Fault { code, .. } => return write!(f, "{}", code),
- };
+ Error::SerdeJsonError(ref err) => err.fmt(f),
+ Error::Http(ref err) => err.fmt(f),
+ Error::Hyper(ref err) => err.fmt(f),
+ Error::IO(ref err) => err.fmt(f),
+ Error::Fault { code, .. } => write!(f, "{}", code),
+ }
}
}
-impl ErrorTrait for Error {
+impl StdError for Error {
fn description(&self) -> &str {
"Shiplift Error"
}
- fn cause(&self) -> Option<&ErrorTrait> {
+ fn cause(&self) -> Option<&StdError> {
match self {
- &Error::SerdeJsonError(ref err) => Some(err),
- &Error::Http(ref err) => Some(err),
- &Error::IO(ref err) => Some(err),
+ Error::SerdeJsonError(ref err) => Some(err),
+ Error::Http(ref err) => Some(err),
+ Error::IO(ref err) => Some(err),
_ => None,
}
}