diff options
Diffstat (limited to 'askama_derive/src/path.rs')
-rw-r--r-- | askama_derive/src/path.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/askama_derive/src/path.rs b/askama_derive/src/path.rs index e48f7d7..28b1b17 100644 --- a/askama_derive/src/path.rs +++ b/askama_derive/src/path.rs @@ -46,6 +46,9 @@ pub fn get_template_source(tpl_file: &str) -> String { }; let mut s = String::new(); f.read_to_string(&mut s).unwrap(); + if s.ends_with('\n') { + let _ = s.pop(); + } s } @@ -56,7 +59,7 @@ mod tests { #[test] fn get_source() { - assert_eq!(get_template_source("sub/b.html"), "bar\n"); + assert_eq!(get_template_source("sub/b.html"), "bar"); } #[test] |