From 2ee157f90449e85c0e43b552bb8653f8dd694e6b Mon Sep 17 00:00:00 2001 From: Ignacio Duart Date: Tue, 26 Sep 2023 13:38:09 +0200 Subject: [PATCH] Box errorkind because of size problems --- rust/src/client_api/client_events.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/src/client_api/client_events.rs b/rust/src/client_api/client_events.rs index 37ce239..6b57fa7 100644 --- a/rust/src/client_api/client_events.rs +++ b/rust/src/client_api/client_events.rs @@ -55,7 +55,7 @@ use super::WsApiError; #[derive(Debug, Serialize, Deserialize)] pub struct ClientError { - kind: ErrorKind, + kind: Box, } impl ClientError { @@ -81,20 +81,22 @@ impl ClientError { } pub fn kind(&self) -> ErrorKind { - self.kind.clone() + (*self.kind).clone() } } impl From for ClientError { fn from(kind: ErrorKind) -> Self { - ClientError { kind } + ClientError { + kind: Box::new(kind), + } } } impl From for ClientError { fn from(cause: String) -> Self { ClientError { - kind: ErrorKind::Unhandled { cause }, + kind: Box::new(ErrorKind::Unhandled { cause }), } } }