This commit is contained in:
Garrett Berg 2017-07-21 12:03:42 -06:00
parent 1e060c55d6
commit 973e4cc8c7

View file

@ -413,7 +413,13 @@ impl<'a> Serializer<'a> {
}, },
'\u{c}' => drop(write!(self.dst, "\\f")), '\u{c}' => drop(write!(self.dst, "\\f")),
'\u{d}' => drop(write!(self.dst, "\\r")), '\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, "\\\\")), '\u{5c}' => drop(write!(self.dst, "\\\\")),
c if c < '\u{1f}' => { c if c < '\u{1f}' => {
drop(write!(self.dst, "\\u{:04X}", ch as u32)) drop(write!(self.dst, "\\u{:04X}", ch as u32))