@@ -23,7 +23,6 @@ use bitcoin::blockdata::script::Script;
2323
2424use ln:: features:: { ChannelFeatures , InitFeatures , NodeFeatures } ;
2525
26- use std:: error:: Error ;
2726use std:: { cmp, fmt} ;
2827use std:: io:: Read ;
2928use std:: result:: Result ;
@@ -688,21 +687,16 @@ pub(crate) struct OnionErrorPacket {
688687 pub ( crate ) data : Vec < u8 > ,
689688}
690689
691- impl Error for DecodeError {
692- fn description ( & self ) -> & str {
693- match * self {
694- DecodeError :: UnknownVersion => "Unknown realm byte in Onion packet" ,
695- DecodeError :: UnknownRequiredFeature => "Unknown required feature preventing decode" ,
696- DecodeError :: InvalidValue => "Nonsense bytes didn't map to the type they were interpreted as" ,
697- DecodeError :: ShortRead => "Packet extended beyond the provided bytes" ,
698- DecodeError :: BadLengthDescriptor => "A length descriptor in the packet didn't describe the later data correctly" ,
699- DecodeError :: Io ( ref e) => e. description ( ) ,
700- }
701- }
702- }
703690impl fmt:: Display for DecodeError {
704691 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
705- f. write_str ( self . description ( ) )
692+ match * self {
693+ DecodeError :: UnknownVersion => f. write_str ( "Unknown realm byte in Onion packet" ) ,
694+ DecodeError :: UnknownRequiredFeature => f. write_str ( "Unknown required feature preventing decode" ) ,
695+ DecodeError :: InvalidValue => f. write_str ( "Nonsense bytes didn't map to the type they were interpreted as" ) ,
696+ DecodeError :: ShortRead => f. write_str ( "Packet extended beyond the provided bytes" ) ,
697+ DecodeError :: BadLengthDescriptor => f. write_str ( "A length descriptor in the packet didn't describe the later data correctly" ) ,
698+ DecodeError :: Io ( ref e) => e. fmt ( f) ,
699+ }
706700 }
707701}
708702
0 commit comments