Skip to content

Commit bd7d2c0

Browse files
committed
Merge #236: Implement From<ChecksumError> for DecodeError
2dc8580 Implement From<ChecksumError> for DecodeError (Tobin C. Harding) Pull request description: Picked changes up from #221. Add an impl of `From<ChecksumError> for DecodeError` since we already have one for the other variant. ACKs for top commit: apoelstra: ACK 2dc8580; successfully ran local tests Tree-SHA512: 67aa251925c607b75454218c19bbbe78f7c838143caae8c4a825bab276443a90a6670ee2741a8e869771983ed41fe5807ec68e92eb0785392fca92d46c1d59fc
2 parents a86da1e + 2dc8580 commit bd7d2c0

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
@@ -494,6 +494,12 @@ impl From<UncheckedHrpstringError> for DecodeError {
494494
fn from(e: UncheckedHrpstringError) -> Self { Self::Parse(e) }
495495
}
496496

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

0 commit comments

Comments
 (0)