File tree Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,12 @@ mod nunchuck {
4040 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
4141 match * self {
4242 NunchuckError :: Error ( ref e) => fmt:: Display :: fmt ( e, f) ,
43- NunchuckError :: ParseError => fmt :: Display :: fmt ( self . description ( ) , f ) ,
43+ NunchuckError :: ParseError => write ! ( f , "Could not parse data" ) ,
4444 }
4545 }
4646 }
4747
4848 impl < E : Error > Error for NunchuckError < E > {
49- fn description ( & self ) -> & str {
50- match * self {
51- NunchuckError :: Error ( ref e) => e. description ( ) ,
52- NunchuckError :: ParseError => "Unable to Parse Data" ,
53- }
54- }
55-
5649 fn cause ( & self ) -> Option < & dyn Error > {
5750 match * self {
5851 NunchuckError :: Error ( ref e) => Some ( e) ,
Original file line number Diff line number Diff line change @@ -72,13 +72,6 @@ impl fmt::Display for LinuxI2CError {
7272}
7373
7474impl Error for LinuxI2CError {
75- fn description ( & self ) -> & str {
76- match * self {
77- LinuxI2CError :: Io ( ref e) => e. description ( ) ,
78- LinuxI2CError :: Nix ( ref e) => e. description ( ) ,
79- }
80- }
81-
8275 fn cause ( & self ) -> Option < & dyn Error > {
8376 match * self {
8477 LinuxI2CError :: Io ( ref e) => Some ( e) ,
You can’t perform that action at this time.
0 commit comments