@@ -178,15 +178,7 @@ impl fmt::Display for SendError {
178
178
}
179
179
}
180
180
181
- impl Error for SendError {
182
- fn description ( & self ) -> & str {
183
- if self . is_full ( ) {
184
- "send failed because channel is full"
185
- } else {
186
- "send failed because receiver is gone"
187
- }
188
- }
189
- }
181
+ impl Error for SendError { }
190
182
191
183
impl SendError {
192
184
/// Returns true if this error is a result of the channel being full.
@@ -224,15 +216,7 @@ impl<T> fmt::Display for TrySendError<T> {
224
216
}
225
217
}
226
218
227
- impl < T : Any > Error for TrySendError < T > {
228
- fn description ( & self ) -> & str {
229
- if self . is_full ( ) {
230
- "send failed because channel is full"
231
- } else {
232
- "send failed because receiver is gone"
233
- }
234
- }
235
- }
219
+ impl < T : Any > Error for TrySendError < T > { }
236
220
237
221
impl < T > TrySendError < T > {
238
222
/// Returns true if this error is a result of the channel being full.
@@ -265,15 +249,11 @@ impl fmt::Debug for TryRecvError {
265
249
266
250
impl fmt:: Display for TryRecvError {
267
251
fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
268
- fmt . write_str ( self . description ( ) )
252
+ write ! ( fmt , "receiver channel is empty" )
269
253
}
270
254
}
271
255
272
- impl Error for TryRecvError {
273
- fn description ( & self ) -> & str {
274
- "receiver channel is empty"
275
- }
276
- }
256
+ impl Error for TryRecvError { }
277
257
278
258
#[ derive( Debug ) ]
279
259
struct Inner < T > {
0 commit comments