Skip to content

Commit

Permalink
Add rustfmt::skip to Display impl
Browse files Browse the repository at this point in the history
`Display` imlps often include long lines but the code is simple and
having it split over 4 lines is a waist of vertical space.
  • Loading branch information
tcharding committed Jan 9, 2024
1 parent b7642a6 commit d692972
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/primitives/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,19 +589,16 @@ pub enum SegwitHrpstringError {
Checksum(ChecksumError),
}

#[rustfmt::skip]
impl fmt::Display for SegwitHrpstringError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use SegwitHrpstringError::*;

match *self {
Unchecked(ref e) => write_err!(f, "parsing unchecked hrpstring failed"; e),
NoData => write!(f, "no data found after removing the checksum"),
TooLong(len) => write!(
f,
"encoded length {} exceeds spec limit {} chars",
len,
segwit::MAX_STRING_LENGTH
),
TooLong(len) =>
write!(f, "encoded length {} exceeds spec limit {} chars", len, segwit::MAX_STRING_LENGTH),
InvalidWitnessVersion(fe) => write!(f, "invalid segwit witness version: {}", fe),
Padding(ref e) => write_err!(f, "invalid padding on the witness data"; e),
WitnessLength(ref e) => write_err!(f, "invalid witness length"; e),
Expand Down

0 comments on commit d692972

Please sign in to comment.