viirya commented on code in PR #3778:
URL: https://github.com/apache/arrow-rs/pull/3778#discussion_r1122274287


##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -81,4 +104,39 @@ impl BooleanBuffer {
     pub fn values(&self) -> &[u8] {
         &self.buffer
     }
+
+    /// Slices this [`BooleanBuffer`] by the provided `offset` and `length`
+    pub fn slice(&self, offset: usize, len: usize) -> Self {
+        assert!(
+            offset.saturating_add(len) <= self.len,
+            "the offset of the new BooleanBuffer cannot exceed the existing 
length"

Review Comment:
   ```suggestion
               "the offset + length of the new BooleanBuffer cannot exceed the 
existing length"
   ```



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