From d692972844e3d8de2d5d5f40b92e0f3bd36a83cf Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 9 Jan 2024 12:24:28 +1100 Subject: [PATCH] Add rustfmt::skip to Display impl `Display` imlps often include long lines but the code is simple and having it split over 4 lines is a waist of vertical space. --- src/primitives/decode.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/primitives/decode.rs b/src/primitives/decode.rs index 386078685..f3c6ff0ca 100644 --- a/src/primitives/decode.rs +++ b/src/primitives/decode.rs @@ -589,6 +589,7 @@ pub enum SegwitHrpstringError { Checksum(ChecksumError), } +#[rustfmt::skip] impl fmt::Display for SegwitHrpstringError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use SegwitHrpstringError::*; @@ -596,12 +597,8 @@ impl fmt::Display for 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),