diff --git a/milli/src/documents/builder.rs b/milli/src/documents/builder.rs index 6ba890b79..f95fa9190 100644 --- a/milli/src/documents/builder.rs +++ b/milli/src/documents/builder.rs @@ -62,7 +62,7 @@ impl DocumentBatchBuilder { /// This method must be called after the document addition is terminated. It will put the /// metadata at the end of the file, and write the metadata offset at the beginning on the /// file. - pub fn finish(self) -> Result<(), Error> { + pub fn finish(self) -> Result { let Self { inner: ByteCounter { mut writer, count: offset }, index, count, .. } = self; let meta = DocumentsMetadata { count, index }; @@ -74,7 +74,7 @@ impl DocumentBatchBuilder { writer.flush()?; - Ok(()) + Ok(count) } /// Extends the builder with json documents from a reader.