viirya commented on code in PR #7843:
URL: https://github.com/apache/arrow-rs/pull/7843#discussion_r2178281660
##########
parquet-variant/src/builder.rs:
##########
@@ -698,6 +718,15 @@ impl<'a, 'b> ObjectBuilder<'a, 'b> {
///
/// This consumes self and writes the object to the parent buffer.
pub fn finish(mut self) -> Result<(), ArrowError> {
+ self._finish()
+ }
+
+ /// Internal function to finalize object
+ ///
+ /// This doesn't consume self but just writes the object to the parent
buffer.
+ fn _finish(&mut self) -> Result<(), ArrowError> {
+ assert!(!self.finished, "ObjectBuilder has already been finished");
Review Comment:
This prevents that dropping a finished builder causes re-finishing it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]