Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit ba4463f

Browse files
committed
Remove redundant error information in PaddingError
1 parent 01cda89 commit ba4463f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/de.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ pub enum ParseError {
582582
TooShortDataPart,
583583
UnexpectedEndOfTaggedFields,
584584
DescriptionDecodeError(str::Utf8Error),
585-
PaddingError(bech32::Error),
585+
PaddingError,
586586
IntegerOverflowError,
587587
InvalidSegWitProgramLength,
588588
InvalidPubKeyHashLength,
@@ -616,9 +616,6 @@ impl Display for ParseError {
616616
DescriptionDecodeError(ref e) => {
617617
write!(f, "{} ({})", self.description(), e)
618618
}
619-
PaddingError(ref e) => {
620-
write!(f, "{} ({})", self.description(), e)
621-
},
622619
InvalidSliceLength(ref function) => {
623620
write!(f, "{} (in function {})", self.description(), function)
624621
}
@@ -643,7 +640,7 @@ impl error::Error for ParseError {
643640
TooShortDataPart => "data part too short (should be at least 111 bech32 chars long)",
644641
UnexpectedEndOfTaggedFields => "tagged fields part ended unexpectedly",
645642
DescriptionDecodeError(_) => "description is no valid utf-8 string",
646-
PaddingError(_) => "some data field had bad padding",
643+
PaddingError => "some data field had bad padding",
647644
IntegerOverflowError => "parsed integer doesn't fit into receiving type",
648645
InvalidSegWitProgramLength => "fallback SegWit program is too long or too short",
649646
InvalidPubKeyHashLength => "fallback public key hash has a length unequal 20 bytes",
@@ -672,7 +669,7 @@ from_error!(ParseError::DescriptionDecodeError, str::Utf8Error);
672669
impl From<bech32::Error> for ParseError {
673670
fn from(e: bech32::Error) -> Self {
674671
match e {
675-
bech32::Error::InvalidPadding => ParseError::PaddingError(e),
672+
bech32::Error::InvalidPadding => ParseError::PaddingError,
676673
_ => ParseError::Bech32Error(e)
677674
}
678675
}

0 commit comments

Comments
 (0)