Use question_mark feature in libserialize.

This commit is contained in:
Ahmed Charles
2016-08-27 07:16:17 -07:00
parent 14d3937e65
commit d73e374ddb
2 changed files with 9 additions and 10 deletions

View File

@@ -475,15 +475,14 @@ impl<'a> Encoder<'a> {
}
macro_rules! emit_enquoted_if_mapkey {
($enc:ident,$e:expr) => {
($enc:ident,$e:expr) => ({
if $enc.is_emitting_map_key {
try!(write!($enc.writer, "\"{}\"", $e));
Ok(())
write!($enc.writer, "\"{}\"", $e)?;
} else {
try!(write!($enc.writer, "{}", $e));
Ok(())
write!($enc.writer, "{}", $e)?;
}
}
Ok(())
})
}
impl<'a> ::Encoder for Encoder<'a> {