@@ -91,10 +91,6 @@ pub trait Error: Debug + Display {
91
91
/// }
92
92
///
93
93
/// impl Error for SuperError {
94
- /// fn description(&self) -> &str {
95
- /// "I'm the superhero of errors"
96
- /// }
97
- ///
98
94
/// fn cause(&self) -> Option<&dyn Error> {
99
95
/// Some(&self.side)
100
96
/// }
@@ -109,11 +105,7 @@ pub trait Error: Debug + Display {
109
105
/// }
110
106
/// }
111
107
///
112
- /// impl Error for SuperErrorSideKick {
113
- /// fn description(&self) -> &str {
114
- /// "I'm SuperError side kick"
115
- /// }
116
- /// }
108
+ /// impl Error for SuperErrorSideKick {}
117
109
///
118
110
/// fn get_super_error() -> Result<(), SuperError> {
119
111
/// Err(SuperError { side: SuperErrorSideKick })
@@ -156,10 +148,6 @@ pub trait Error: Debug + Display {
156
148
/// }
157
149
///
158
150
/// impl Error for SuperError {
159
- /// fn description(&self) -> &str {
160
- /// "I'm the superhero of errors"
161
- /// }
162
- ///
163
151
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
164
152
/// Some(&self.side)
165
153
/// }
@@ -174,11 +162,7 @@ pub trait Error: Debug + Display {
174
162
/// }
175
163
/// }
176
164
///
177
- /// impl Error for SuperErrorSideKick {
178
- /// fn description(&self) -> &str {
179
- /// "I'm SuperError side kick"
180
- /// }
181
- /// }
165
+ /// impl Error for SuperErrorSideKick {}
182
166
///
183
167
/// fn get_super_error() -> Result<(), SuperError> {
184
168
/// Err(SuperError { side: SuperErrorSideKick })
@@ -251,11 +235,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
251
235
/// }
252
236
/// }
253
237
///
254
- /// impl Error for AnError {
255
- /// fn description(&self) -> &str {
256
- /// "Description of an error"
257
- /// }
258
- /// }
238
+ /// impl Error for AnError {}
259
239
///
260
240
/// let an_error = AnError;
261
241
/// assert!(0 == mem::size_of_val(&an_error));
@@ -290,11 +270,7 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
290
270
/// }
291
271
/// }
292
272
///
293
- /// impl Error for AnError {
294
- /// fn description(&self) -> &str {
295
- /// "Description of an error"
296
- /// }
297
- /// }
273
+ /// impl Error for AnError {}
298
274
///
299
275
/// unsafe impl Send for AnError {}
300
276
///
0 commit comments