diff --git a/src/storage/json/parser.rs b/src/storage/json/parser.rs index fc663303..b2ea1e1d 100644 --- a/src/storage/json/parser.rs +++ b/src/storage/json/parser.rs @@ -45,9 +45,16 @@ impl FileHeaderParser for JsonHeaderParser { } fn write(&self, data: &FileHeaderData) -> Result { - let mut ser = Serializer::pretty(stdout()); - data.serialize(&mut ser); - Ok(String::from("")) + let mut s = Vec::::new(); + { + let mut ser = Serializer::pretty(&mut s); + data.serialize(&mut ser); + } + + String::from_utf8(s).or( + Err(ParserError::short("Cannot parse utf8 bytes", + String::from(""), + 0))) } }