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 {
40
40
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
41
41
match * self {
42
42
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" ) ,
44
44
}
45
45
}
46
46
}
47
47
48
48
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
-
56
49
fn cause ( & self ) -> Option < & dyn Error > {
57
50
match * self {
58
51
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 {
72
72
}
73
73
74
74
impl 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
-
82
75
fn cause ( & self ) -> Option < & dyn Error > {
83
76
match * self {
84
77
LinuxI2CError :: Io ( ref e) => Some ( e) ,
You can’t perform that action at this time.
0 commit comments