From f76e29779d7c8fc3ce8d0260e8367326a02b09f3 Mon Sep 17 00:00:00 2001 From: Ethiraric Date: Sun, 7 Jul 2024 19:31:36 +0200 Subject: [PATCH] Minor style improvements. --- src/emitter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emitter.rs b/src/emitter.rs index c98814e..8b9a0be 100644 --- a/src/emitter.rs +++ b/src/emitter.rs @@ -253,9 +253,9 @@ impl<'a> YamlEmitter<'a> { fn emit_literal_block(&mut self, v: &str) -> EmitResult { let ends_with_newline = v.ends_with('\n'); if ends_with_newline { - write!(self.writer, "|")?; + self.writer.write_str("|")?; } else { - write!(self.writer, "|-")?; + self.writer.write_str("|-")?; } self.level += 1; @@ -264,7 +264,7 @@ impl<'a> YamlEmitter<'a> { writeln!(self.writer)?; self.write_indent()?; // It's literal text, so don't escape special chars. - write!(self.writer, "{line}")?; + self.writer.write_str(line)?; } self.level -= 1; Ok(())