scovich commented on code in PR #9155:
URL: https://github.com/apache/arrow-rs/pull/9155#discussion_r2687123920


##########
arrow-buffer/src/builder/null.rs:
##########
@@ -193,13 +196,23 @@ impl NullBufferBuilder {
         }
     }
 
-    /// Builds the null buffer and resets the builder.
-    /// Returns `None` if the builder only contains `true`s.
+    /// Builds the [`NullBuffer`] and resets the builder.
+    ///
+    /// Returns `None` if the builder only contains `true`s. Use 
[`Self::build`]
+    /// when you don't need to reuse this builder.
     pub fn finish(&mut self) -> Option<NullBuffer> {
         self.len = 0;
         Some(NullBuffer::new(self.bitmap_builder.take()?.finish()))
     }
 
+    /// Builds the [`NullBuffer`] without resetting the builder.
+    ///
+    /// This consumes the builder. Use [`Self::finish`] to reuse it.
+    pub fn build(self) -> Option<NullBuffer> {
+        self.bitmap_builder
+            .map(|mut builder| NullBuffer::new(builder.finish()))

Review Comment:
   aside: Is there an impl From that would allow this?
   ```suggestion
           self.bitmap_builder.map(Into::into)
   ```



-- 
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]

Reply via email to