From 0c437ca9d3ec778022fcb9b6586e50220d690238 Mon Sep 17 00:00:00 2001 From: Chris Wong <lambda.fairy@gmail.com> Date: Sun, 25 Sep 2016 12:25:21 +1300 Subject: [PATCH] Do not implement traits on type aliases Due to rust-lang/rust#19381, trait `impl`s on type aliases are not shown in automatically generated documentation. Until this bug is fixed, it is better not to write code this way. --- maud/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maud/src/lib.rs b/maud/src/lib.rs index afb7ed6..812269b 100644 --- a/maud/src/lib.rs +++ b/maud/src/lib.rs @@ -86,7 +86,7 @@ impl<'a> Render for PreEscaped<&'a str> { /// The `html!` macro expands to an expression of this type. pub type Markup = PreEscaped<String>; -impl Markup { +impl PreEscaped<String> { /// Extracts the inner `String`. This is a synonym for `self.0`. pub fn into_string(self) -> String { self.0 @@ -153,9 +153,9 @@ mod iron_support { use iron::modifier::{Modifier, Set}; use iron::modifiers::Header; use iron::response::{Response, ResponseBody, WriteBody}; - use Markup; + use PreEscaped; - impl Modifier<Response> for Markup { + impl Modifier<Response> for PreEscaped<String> { fn modify(self, response: &mut Response) { response .set_mut(Header(ContentType::html())) @@ -163,7 +163,7 @@ mod iron_support { } } - impl WriteBody for Markup { + impl WriteBody for PreEscaped<String> { fn write_body(&mut self, body: &mut ResponseBody) -> io::Result<()> { self.0.write_body(body) }