diff --git a/contracts/okp4-cognitarium/src/rdf/serde.rs b/contracts/okp4-cognitarium/src/rdf/serde.rs index 66d4ad61..f9d3bd63 100644 --- a/contracts/okp4-cognitarium/src/rdf/serde.rs +++ b/contracts/okp4-cognitarium/src/rdf/serde.rs @@ -68,7 +68,7 @@ impl TripleReader { } impl TripleWriter { - pub fn new(format: DataFormat, dst: W) -> Self { + pub fn new(format: &DataFormat, dst: W) -> Self { TripleWriter { writer: match format { DataFormat::RDFXml => TriplesWriterKind::RdfXml(RdfXmlFormatter::new(dst)), @@ -110,7 +110,7 @@ impl TripleWriter { Ok(()) } - pub fn finish(self) -> io::Result<()> { + pub fn finish(self) -> io::Result { match self.writer { TriplesWriterKind::Turtle(formatter) => formatter.finish(), TriplesWriterKind::NTriples(formatter) => formatter.finish(), @@ -120,7 +120,6 @@ impl TripleWriter { Err(e) => Err(io::Error::new(io::ErrorKind::Other, e.to_string())), }, } - .map(|_| ()) } }