Skip to content

Commit 5c51c7f

Browse files
imp: implement From<Infallible> for ClientError (#1359)
* imp: implement Infallible for ClientError * chore: add changelog
1 parent e50ae6c commit 5c51c7f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [ibc-core] Implement `From<Infallible>` for `ClientError`
2+
([#1356](https://github.com/cosmos/ibc-rs/issues/1356)).

ibc-core/ics02-client/types/src/error.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Defines the client error type
22
3+
use core::convert::Infallible;
4+
35
use displaydoc::Display;
46
use ibc_core_commitment_types::error::CommitmentError;
57
use ibc_core_host_types::error::{DecodingError, HostError, IdentifierError};
@@ -88,6 +90,12 @@ impl From<TimestampError> for ClientError {
8890
}
8991
}
9092

93+
impl From<Infallible> for ClientError {
94+
fn from(value: Infallible) -> Self {
95+
match value {}
96+
}
97+
}
98+
9199
#[cfg(feature = "std")]
92100
impl std::error::Error for ClientError {
93101
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {

ibc-core/ics24-host/types/src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ impl From<ProtoError> for DecodingError {
125125
}
126126
}
127127

128+
impl From<ProstError> for DecodingError {
129+
fn from(e: ProstError) -> Self {
130+
Self::Prost(e)
131+
}
132+
}
133+
128134
impl From<Base64Error> for DecodingError {
129135
fn from(e: Base64Error) -> Self {
130136
Self::Base64(e)

0 commit comments

Comments
 (0)