1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 00:27:43 +02:00

Add Display impl for TimeoutError

This commit is contained in:
Nikolay Kim
2019-02-11 08:34:57 -08:00
parent e354c6df92
commit b8f9bf4bc8
3 changed files with 17 additions and 1 deletions

View File

@ -41,6 +41,15 @@ impl<E: fmt::Debug> fmt::Debug for TimeoutError<E> {
}
}
impl<E: fmt::Display> fmt::Display for TimeoutError<E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
TimeoutError::Service(e) => e.fmt(f),
TimeoutError::Timeout => write!(f, "Service call timeout"),
}
}
}
impl<E: PartialEq> PartialEq for TimeoutError<E> {
fn eq(&self, other: &TimeoutError<E>) -> bool {
match self {