[meta] Fix outdented_line in srcgen;

This commit is contained in:
Benjamin Bouvier
2019-04-12 18:34:20 +02:00
parent d2d2cdcd78
commit 00429ebe99

View File

@@ -80,9 +80,9 @@ impl Formatter {
/// Get a string containing whitespace outdented one level. Used for /// Get a string containing whitespace outdented one level. Used for
/// lines of code that are inside a single indented block. /// lines of code that are inside a single indented block.
fn _get_outdent(&mut self) -> String { fn _get_outdent(&mut self) -> String {
self.indent_push();
let s = self.get_indent();
self.indent_pop(); self.indent_pop();
let s = self.get_indent();
self.indent_push();
s s
} }
@@ -99,7 +99,7 @@ impl Formatter {
/// Emit a line outdented one level. /// Emit a line outdented one level.
pub fn _outdented_line(&mut self, s: &str) { pub fn _outdented_line(&mut self, s: &str) {
let new_line = format!("{}{}", self._get_outdent(), s); let new_line = format!("{}{}\n", self._get_outdent(), s);
self.lines.push(new_line); self.lines.push(new_line);
} }