You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/19 09:16:15 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2515: Booleanbuilder refactor

tustvold commented on code in PR #2515:
URL: https://github.com/apache/arrow-rs/pull/2515#discussion_r949988233


##########
arrow/src/array/builder/boolean_builder.rs:
##########
@@ -67,8 +67,14 @@ pub struct BooleanBuilder {
 }
 
 impl BooleanBuilder {
-    /// Creates a new primitive array builder
-    pub fn new(capacity: usize) -> Self {
+    /// Creates a new boolean builder
+    #[allow(clippy::new_without_default)]

Review Comment:
   I think we probably should define Default



##########
arrow/src/array/builder/boolean_builder.rs:
##########
@@ -67,8 +67,14 @@ pub struct BooleanBuilder {
 }
 
 impl BooleanBuilder {
-    /// Creates a new primitive array builder
-    pub fn new(capacity: usize) -> Self {
+    /// Creates a new boolean builder
+    #[allow(clippy::new_without_default)]
+    pub fn new() -> Self {
+        Self::with_capacity(1024)
+    }
+
+    /// Creates a new boolean builder with capacity

Review Comment:
   ```suggestion
       /// Creates a new boolean builder with space for `capacity` elements without re-allocating
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org