Skip to content

Commit 2dc8580

Browse files
committed
Implement From<ChecksumError> for DecodeError
Picked changes up from #221. Add an impl of `From<ChecksumError> for DecodeError` since we already have one for the other variant.
1 parent b7fab3a commit 2dc8580

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,12 @@ impl From<UncheckedHrpstringError> for DecodeError {
495495
fn from(e: UncheckedHrpstringError) -> Self { Self::Parse(e) }
496496
}
497497

498+
#[cfg(feature = "alloc")]
499+
impl From<ChecksumError> for DecodeError {
500+
#[inline]
501+
fn from(e: ChecksumError) -> Self { Self::Checksum(e) }
502+
}
503+
498504
/// An error while encoding a bech32 string.
499505
#[derive(Debug, Clone, PartialEq, Eq)]
500506
#[non_exhaustive]

0 commit comments

Comments
 (0)