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) }