From e5a5cc5cb8b8839384d216e170099ef4a69d0da4 Mon Sep 17 00:00:00 2001 From: Jonah Lund Date: Wed, 16 Oct 2024 14:31:55 +0200 Subject: [PATCH] fix: escape literals --- macros/src/fmt.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macros/src/fmt.rs b/macros/src/fmt.rs index fafd7ad..400b764 100644 --- a/macros/src/fmt.rs +++ b/macros/src/fmt.rs @@ -72,7 +72,10 @@ impl<'a, 'b> Formatter<'a, 'b> { #[inline] pub fn write_value(&mut self, v: &'b ast::Value) -> Result { match v { - ast::Value::LitStr(lit_str) => self.write_str(&lit_str.value()), + ast::Value::LitStr(lit_str) => { + lit_str.value().render_to(self.buf); + Ok(()) + } ast::Value::Expr(expr) => self.write_expr(expr), } }