From abab1aca8c1e01c4bc36d505666fae6bb51e75ea Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 22 Dec 2021 11:03:02 +0100 Subject: [PATCH] Store richer Box in Error::Other --- src/connection.rs | 2 +- src/error.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index f72f591..258b6e7 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -147,7 +147,7 @@ async fn epp_connect( .collect(); builder .with_single_cert(certs, rustls::PrivateKey(key.0)) - .map_err(|e| Error::Other(e.to_string()))? + .map_err(|e| Error::Other(e.into()))? } None => builder.with_no_client_auth(), }; diff --git a/src/error.rs b/src/error.rs index 2f9a983..100f896 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,7 +12,7 @@ pub enum Error { Io(std::io::Error), Command(ResponseStatus), Xml(Box), - Other(String), + Other(Box), } impl StdError for Error {} @@ -31,7 +31,7 @@ impl Display for Error { impl From> for Error { fn from(e: Box) -> Self { - Self::Other(format!("{:?}", e)) + Self::Other(e) } }