@@ -23,7 +23,6 @@ use bitcoin::blockdata::script::Script;
23
23
24
24
use ln:: features:: { ChannelFeatures , InitFeatures , NodeFeatures } ;
25
25
26
- use std:: error:: Error ;
27
26
use std:: { cmp, fmt} ;
28
27
use std:: io:: Read ;
29
28
use std:: result:: Result ;
@@ -688,21 +687,16 @@ pub(crate) struct OnionErrorPacket {
688
687
pub ( crate ) data : Vec < u8 > ,
689
688
}
690
689
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
- }
703
690
impl fmt:: Display for DecodeError {
704
691
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
+ }
706
700
}
707
701
}
708
702
0 commit comments