Skip to content

Commit

Permalink
fix: no_std does not build
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jan 8, 2025
1 parent 86a86ea commit e82a9bf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions abci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,27 @@ pub enum Error {
#[error("connection error")]
Connection(#[from] io::Error),
#[error("cannot decode protobuf message")]
Decode(#[from] DecodeError),
Decode(DecodeError),
#[error("cannot encode protobuf message")]
Encode(#[from] EncodeError),
Encode(EncodeError),
#[error("cannot create canonical message: {0}")]
Canonical(String),
#[error("server terminated")]
Cancelled(),
#[error("async runtime error")]
Async(String),
}

// manually implemented due to no_std compatibility
impl From<EncodeError> for Error {
fn from(error: EncodeError) -> Error {
Error::Encode(error)
}
}

// manually implemented due to no_std compatibility
impl From<DecodeError> for Error {
fn from(error: DecodeError) -> Error {
Error::Decode(error)
}
}

0 comments on commit e82a9bf

Please sign in to comment.