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


##########
arrow-data/src/byte_view.rs:
##########
@@ -32,6 +32,18 @@ pub struct ByteView {
 }
 
 impl ByteView {
+    /// Try to create a [`ByteView`] from the provided `v`
+    ///
+    /// If `v` instead contains the binary data inline, returns an `Err` 
containing it
+    #[inline]
+    pub fn try_new(v: &u128) -> Result<Self, &[u8]> {

Review Comment:
   > One case is creating the u128 initially (e.g. if we should copy 4 bytes or 
up to 12)
   
   Right, but does this need to be its own type, or could it be a free 
function? I don't know the answer to this, yet, but I would always take no 
abstraction over a bad abstraction



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to