From 271a807ab05080d1d7d2a6fc7832fe6e3dd3cdfc Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Tue, 27 Jul 2021 15:10:07 +0200 Subject: [PATCH] Fix emission of TOML strings (in particular, quoting) --- src/toml.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/toml.rs b/src/toml.rs index 763b366..ab558e7 100644 --- a/src/toml.rs +++ b/src/toml.rs @@ -172,9 +172,8 @@ struct PrintExpr(&'static Expr); impl fmt::Display for PrintExpr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self.0 { - // TODO: escape stuff! - Expr::Str(v) => write!(f, "\"{}\"", v), + match *self.0 { + Expr::Str(v) => toml::Value::String(v.to_owned()).fmt(f), Expr::Float(v) => v.fmt(f), Expr::Integer(v) => v.fmt(f), Expr::Bool(v) => v.fmt(f),