diff --git a/actix-utils/CHANGES.md b/actix-utils/CHANGES.md index 714e119c..4a491a60 100644 --- a/actix-utils/CHANGES.md +++ b/actix-utils/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [0.2.2] - 2019-02-11 + +### Added + +* Add `Display` impl for `TimeoutError` + + ## [0.2.1] - 2019-02-06 ### Added diff --git a/actix-utils/Cargo.toml b/actix-utils/Cargo.toml index b7c0f64f..aa626e03 100644 --- a/actix-utils/Cargo.toml +++ b/actix-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-utils" -version = "0.2.1" +version = "0.2.2" authors = ["Nikolay Kim "] description = "Actix utils - various actix net related services" keywords = ["network", "framework", "async", "futures"] diff --git a/actix-utils/src/timeout.rs b/actix-utils/src/timeout.rs index 1ada86f4..49689030 100644 --- a/actix-utils/src/timeout.rs +++ b/actix-utils/src/timeout.rs @@ -41,6 +41,15 @@ impl fmt::Debug for TimeoutError { } } +impl fmt::Display for TimeoutError { + 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 PartialEq for TimeoutError { fn eq(&self, other: &TimeoutError) -> bool { match self {