@@ -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 })
@@ -159,10 +151,6 @@ pub trait Error: Debug + Display {
159
151
/// }
160
152
///
161
153
/// impl Error for SuperError {
162
- /// fn description(&self) -> &str {
163
- /// "I'm the superhero of errors"
164
- /// }
165
- ///
166
154
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
167
155
/// Some(&self.side)
168
156
/// }
@@ -177,11 +165,7 @@ pub trait Error: Debug + Display {
177
165
/// }
178
166
/// }
179
167
///
180
- /// impl Error for SuperErrorSideKick {
181
- /// fn description(&self) -> &str {
182
- /// "I'm SuperError side kick"
183
- /// }
184
- /// }
168
+ /// impl Error for SuperErrorSideKick {}
185
169
///
186
170
/// fn get_super_error() -> Result<(), SuperError> {
187
171
/// Err(SuperError { side: SuperErrorSideKick })
@@ -261,11 +245,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
261
245
/// }
262
246
/// }
263
247
///
264
- /// impl Error for AnError {
265
- /// fn description(&self) -> &str {
266
- /// "Description of an error"
267
- /// }
268
- /// }
248
+ /// impl Error for AnError {}
269
249
///
270
250
/// let an_error = AnError;
271
251
/// assert!(0 == mem::size_of_val(&an_error));
@@ -300,11 +280,7 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
300
280
/// }
301
281
/// }
302
282
///
303
- /// impl Error for AnError {
304
- /// fn description(&self) -> &str {
305
- /// "Description of an error"
306
- /// }
307
- /// }
283
+ /// impl Error for AnError {}
308
284
///
309
285
/// unsafe impl Send for AnError {}
310
286
///
0 commit comments