From a18ddb3b616b8c4c910fc927f6d72272319675c2 Mon Sep 17 00:00:00 2001 From: Shell Chen Date: Wed, 17 Jul 2019 11:22:03 +0800 Subject: [PATCH] timer: impl Into for Elpased (#1321) That convert Elpased to ErrorKind::TimedOut --- tokio-timer/src/timeout.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio-timer/src/timeout.rs b/tokio-timer/src/timeout.rs index 9fe0cd557..cf4199155 100644 --- a/tokio-timer/src/timeout.rs +++ b/tokio-timer/src/timeout.rs @@ -220,3 +220,9 @@ impl fmt::Display for Elapsed { } impl std::error::Error for Elapsed {} + +impl Into for Elapsed { + fn into(self) -> std::io::Error { + std::io::ErrorKind::TimedOut.into() + } +}