Use return value from serialize() and print debug output on failure

This commit is contained in:
Matthias Beyer 2016-01-05 16:20:55 +01:00
parent f8d90af6d0
commit b772b34837

View file

@ -70,7 +70,9 @@ impl FileHeaderParser for JsonHeaderParser {
let mut s = Vec::<u8>::new();
{
let mut ser = Serializer::pretty(&mut s);
data.serialize(&mut ser);
data.serialize(&mut ser).map_err(|e| {
debug!("Serializer error: {:?}", e);
}).ok();
}
String::from_utf8(s).or(