From e0bc36051ad764a9032d88ce016b41f7214e4bc2 Mon Sep 17 00:00:00 2001 From: Garrett Berg Date: Fri, 21 Jul 2017 12:03:42 -0600 Subject: fix " --- src/ser.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ser.rs b/src/ser.rs index 2431737..283fee9 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -413,7 +413,13 @@ impl<'a> Serializer<'a> { }, '\u{c}' => drop(write!(self.dst, "\\f")), '\u{d}' => drop(write!(self.dst, "\\r")), - '\u{22}' => drop(write!(self.dst, "\\\"")), + '\u{22}' => { + if do_pretty { + drop(write!(self.dst, "\"")) + } else { + drop(write!(self.dst, "\\\"")) + } + }, '\u{5c}' => drop(write!(self.dst, "\\\\")), c if c < '\u{1f}' => { drop(write!(self.dst, "\\u{:04X}", ch as u32)) -- cgit v1.2.3