From db72cb5187b44bf61d656c343be26e0ee6520e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Fri, 28 Nov 2014 03:49:40 -0800 Subject: [PATCH] Fix `HeaderFormatter`. Issue #157 --- src/header/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/header/mod.rs b/src/header/mod.rs index a42ec1cc..bd2609a4 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -481,12 +481,12 @@ impl hash::Hash for CaseInsensitive { /// A wrapper around any Header with a Show impl that calls fmt_header. /// -/// This can be used like so: `format!("{}", ShowHeader(header))` to +/// This can be used like so: `format!("{}", HeaderFormatter(&header))` to /// get the representation of a Header which will be written to an /// outgoing TcpStream. -pub struct HeaderFormatter(H); +pub struct HeaderFormatter<'a, H: HeaderFormat>(pub &'a H); -impl Show for HeaderFormatter { +impl<'a, H: HeaderFormat> Show for HeaderFormatter<'a, H> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt_header(f) }