From 6b60c9e2302abb1a40d06af271a08c7cf19a1cc8 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 19 Nov 2018 16:11:58 -0800 Subject: [PATCH] add debug impl for H1ServiceResult --- src/h1/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/h1/mod.rs b/src/h1/mod.rs index 395d6619..da80e55e 100644 --- a/src/h1/mod.rs +++ b/src/h1/mod.rs @@ -1,4 +1,6 @@ //! HTTP/1 implementation +use std::fmt; + use actix_net::codec::Framed; use bytes::Bytes; @@ -23,6 +25,20 @@ pub enum H1ServiceResult { Unhandled(Request, Framed), } +impl fmt::Debug for H1ServiceResult { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + H1ServiceResult::Disconnected => write!(f, "H1ServiceResult::Disconnected"), + H1ServiceResult::Shutdown(ref v) => { + write!(f, "H1ServiceResult::Shutdown({:?})", v) + } + H1ServiceResult::Unhandled(ref req, _) => { + write!(f, "H1ServiceResult::Unhandled({:?})", req) + } + } + } +} + #[derive(Debug)] /// Codec message pub enum Message {