Skip to content

Commit

Permalink
Box errorkind because of size problems
Browse files Browse the repository at this point in the history
  • Loading branch information
iduartgomez committed Sep 26, 2023
1 parent 26c7acf commit 2ee157f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rust/src/client_api/client_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use super::WsApiError;

#[derive(Debug, Serialize, Deserialize)]
pub struct ClientError {
kind: ErrorKind,
kind: Box<ErrorKind>,
}

impl ClientError {
Expand All @@ -81,20 +81,22 @@ impl ClientError {
}

pub fn kind(&self) -> ErrorKind {
self.kind.clone()
(*self.kind).clone()
}
}

impl From<ErrorKind> for ClientError {
fn from(kind: ErrorKind) -> Self {
ClientError { kind }
ClientError {
kind: Box::new(kind),
}
}
}

impl From<String> for ClientError {
fn from(cause: String) -> Self {
ClientError {
kind: ErrorKind::Unhandled { cause },
kind: Box::new(ErrorKind::Unhandled { cause }),
}
}
}
Expand Down

0 comments on commit 2ee157f

Please sign in to comment.