aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 3e050d5..bc24c06 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -943,17 +943,16 @@ impl Buffer {
}
fn writeln(&mut self, s: &str) {
- if s.is_empty() {
- return;
- }
if s == "}" {
self.dedent();
}
- self.write(s);
+ if !s.is_empty() {
+ self.write(s);
+ }
+ self.buf.push('\n');
if s.ends_with('{') {
self.indent();
}
- self.buf.push('\n');
self.start = true;
}