mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
sync: impl Error for mpsc error types (#937)
This commit is contained in:
@@ -180,3 +180,18 @@ impl<T> From<(T, chan::TrySendError)> for UnboundedTrySendError<T> {
|
||||
UnboundedTrySendError(value)
|
||||
}
|
||||
}
|
||||
|
||||
// ===== impl UnboundedRecvError =====
|
||||
|
||||
impl fmt::Display for UnboundedRecvError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
use std::error::Error;
|
||||
write!(fmt, "{}", self.description())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::error::Error for UnboundedRecvError {
|
||||
fn description(&self) -> &str {
|
||||
"channel closed"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user