From 0a26ac76448ce210b2c5d3820c014ec1c82642e8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 8 Feb 2017 14:13:39 +0100 Subject: Simplify write_lit() method --- askama/src/generator.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/askama/src/generator.rs b/askama/src/generator.rs index d3e3746..5fe127e 100644 --- a/askama/src/generator.rs +++ b/askama/src/generator.rs @@ -118,9 +118,7 @@ impl Generator { } fn write_lit(&mut self, s: &str) { - self.write("writer.write_str("); - self.write(&format!("{:#?}", s)); - self.writeln(").unwrap();"); + self.write(&format!("writer.write_str({:#?}).unwrap();", s)); } fn write_expr(&mut self, s: &Expr) { -- cgit