From b9cb5b82e6c87bf0f6037d097476d69f5241bf3a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 6 Aug 2017 14:51:56 +0200 Subject: Merge handling of trailing newline into get_template_source() --- askama_derive/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'askama_derive/src/lib.rs') diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 370c24d..153e352 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -66,10 +66,7 @@ fn get_template_meta(ast: &syn::DeriveInput) -> TemplateMeta { /// value as passed to the `template()` attribute. fn build_template(ast: &syn::DeriveInput) -> String { let meta = get_template_meta(ast); - let mut src = path::get_template_source(&meta.path); - if src.ends_with('\n') { - let _ = src.pop(); - } + let src = path::get_template_source(&meta.path); let nodes = parser::parse(&src); if meta.print == "ast" || meta.print == "all" { println!("{:?}", nodes); -- cgit