From b1e0647192a547b4a51d671565f0b2c6b7f37b74 Mon Sep 17 00:00:00 2001 From: Chris Wong <lambda.fairy@gmail.com> Date: Fri, 27 Feb 2015 17:25:27 +1300 Subject: [PATCH] Remove cow moo --- maud_macros/src/render.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maud_macros/src/render.rs b/maud_macros/src/render.rs index d84ee89..8842abc 100644 --- a/maud_macros/src/render.rs +++ b/maud_macros/src/render.rs @@ -1,4 +1,3 @@ -use std::borrow::IntoCow; use syntax::ast::{Expr, Ident, Stmt}; use syntax::ext::base::ExtCtxt; use syntax::ext::build::AstBuilder; @@ -74,11 +73,12 @@ impl<'cx, 's> Renderer<'cx, 's> { /// Append a literal string, with the specified escaping method. pub fn string(&mut self, s: &str, escape: Escape) { + let escaped; let s = match escape { - Escape::PassThru => s.into_cow(), - Escape::Escape => maud::escape(s).into_cow(), + Escape::PassThru => s, + Escape::Escape => { escaped = maud::escape(s); &*escaped }, }; - self.write(&s); + self.write(s); } /// Append the result of an expression, with the specified escaping method.