mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
committed by
Carl Lerche
parent
516251052d
commit
0651f09427
@@ -58,20 +58,15 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for Error {
|
||||
fn description(&self) -> &str {
|
||||
use self::Kind::*;
|
||||
|
||||
match self.0 {
|
||||
Shutdown => "timer is shutdown",
|
||||
AtCapacity => "timer is at capacity and cannot create a new entry",
|
||||
}
|
||||
}
|
||||
}
|
||||
impl error::Error for Error {}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
use std::error::Error;
|
||||
self.description().fmt(fmt)
|
||||
use self::Kind::*;
|
||||
let descr = match self.0 {
|
||||
Shutdown => "timer is shutdown",
|
||||
AtCapacity => "timer is at capacity and cannot create a new entry",
|
||||
};
|
||||
write!(fmt, "{}", descr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user