Skip to content

Commit

Permalink
imp: use derive_more::From for ChannelError
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Sep 18, 2024
1 parent eb257d6 commit 2cd8ea0
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions ibc-core/ics04-channel/types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::timeout::TimeoutTimestamp;
use crate::Version;

/// Errors that arise from the ICS04 Channel module
#[derive(Debug, Display)]
#[derive(Debug, Display, derive_more::From)]
pub enum ChannelError {
/// decoding error: `{0}`
Decoding(DecodingError),
Expand Down Expand Up @@ -83,36 +83,6 @@ impl From<IdentifierError> for ChannelError {
}
}

impl From<DecodingError> for ChannelError {
fn from(e: DecodingError) -> Self {
Self::Decoding(e)
}
}

impl From<HostError> for ChannelError {
fn from(e: HostError) -> Self {
Self::Host(e)
}
}

impl From<ConnectionError> for ChannelError {
fn from(e: ConnectionError) -> Self {
Self::Connection(e)
}
}

impl From<ClientError> for ChannelError {
fn from(e: ClientError) -> Self {
Self::Client(e)
}
}

impl From<TimestampError> for ChannelError {
fn from(e: TimestampError) -> Self {
Self::InvalidTimeoutTimestamp(e)
}
}

#[cfg(feature = "std")]
impl std::error::Error for ChannelError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Expand Down

0 comments on commit 2cd8ea0

Please sign in to comment.