From 698bab9b2b918c1fa12998f2006d080658404990 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 21 Nov 2022 11:38:56 -0800 Subject: [PATCH] Reduce Error type size by boxing result state --- Cargo.toml | 2 +- src/client.rs | 4 ++-- src/error.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f3eb42c..3c7dae1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "epp-client" -version = "0.4.0" +version = "0.5.0" edition = "2018" license = "MIT" authors = ["Ritesh Chitlangi "] diff --git a/src/client.rs b/src/client.rs index b043b0f..e9fa9d3 100644 --- a/src/client.rs +++ b/src/client.rs @@ -138,10 +138,10 @@ impl EppClient { return Ok(rsp.data); } - let err = crate::error::Error::Command(ResponseStatus { + let err = crate::error::Error::Command(Box::new(ResponseStatus { result: rsp.data.result, tr_ids: rsp.data.tr_ids, - }); + })); error!(%response, "Failed to deserialize response for transaction: {}", err); Err(err) diff --git a/src/error.rs b/src/error.rs index d170579..5a2e3f0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -13,7 +13,7 @@ use crate::response::ResponseStatus; /// Error enum holding the possible error types #[derive(Debug)] pub enum Error { - Command(ResponseStatus), + Command(Box), Io(std::io::Error), Timeout, Xml(Box),