Reduce Error type size by boxing result state

This commit is contained in:
Dirkjan Ochtman 2022-11-21 11:38:56 -08:00 committed by masalachai
parent 406f63e02e
commit 698bab9b2b
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "epp-client" name = "epp-client"
version = "0.4.0" version = "0.5.0"
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
authors = ["Ritesh Chitlangi <ritesh@ayravat.com>"] authors = ["Ritesh Chitlangi <ritesh@ayravat.com>"]

View File

@ -138,10 +138,10 @@ impl<C: Connector> EppClient<C> {
return Ok(rsp.data); return Ok(rsp.data);
} }
let err = crate::error::Error::Command(ResponseStatus { let err = crate::error::Error::Command(Box::new(ResponseStatus {
result: rsp.data.result, result: rsp.data.result,
tr_ids: rsp.data.tr_ids, tr_ids: rsp.data.tr_ids,
}); }));
error!(%response, "Failed to deserialize response for transaction: {}", err); error!(%response, "Failed to deserialize response for transaction: {}", err);
Err(err) Err(err)

View File

@ -13,7 +13,7 @@ use crate::response::ResponseStatus;
/// Error enum holding the possible error types /// Error enum holding the possible error types
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
Command(ResponseStatus), Command(Box<ResponseStatus>),
Io(std::io::Error), Io(std::io::Error),
Timeout, Timeout,
Xml(Box<dyn StdError + Send + Sync>), Xml(Box<dyn StdError + Send + Sync>),