Add from conversion

This is needed for tokio-openssl
This commit is contained in:
Steven Fackler 2018-01-10 22:26:32 -08:00
parent 693ef3178f
commit be1e787ce6
1 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,15 @@ impl Error {
}
}
impl From<ErrorStack> for Error {
fn from(e: ErrorStack) -> Error {
Error {
code: ErrorCode::SSL,
cause: Some(InnerError::Ssl(e)),
}
}
}
impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self.code {