mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
committed by
Carl Lerche
parent
516251052d
commit
0651f09427
@@ -154,20 +154,19 @@ where
|
||||
|
||||
impl fmt::Display for BlockingError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "{}", self.description())
|
||||
write!(
|
||||
fmt,
|
||||
"`blocking` annotation used from outside the context of a thread pool"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for BlockingError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("BlockingError")
|
||||
.field("reason", &self.description())
|
||||
.field("reason", &format!("{}", self))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for BlockingError {
|
||||
fn description(&self) -> &str {
|
||||
"`blocking` annotation used from outside the context of a thread pool"
|
||||
}
|
||||
}
|
||||
impl Error for BlockingError {}
|
||||
|
||||
@@ -84,12 +84,8 @@ impl Unpark for DefaultUnpark {
|
||||
|
||||
impl fmt::Display for ParkError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.description().fmt(fmt)
|
||||
write!(fmt, "unknown park error")
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for ParkError {
|
||||
fn description(&self) -> &str {
|
||||
"unknown park error"
|
||||
}
|
||||
}
|
||||
impl Error for ParkError {}
|
||||
|
||||
Reference in New Issue
Block a user