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


##########
arrow-cast/src/cast.rs:
##########
@@ -3460,39 +3460,41 @@ fn cast_list_inner<OffsetSize: OffsetSizeTrait>(
     Ok(Arc::new(list) as ArrayRef)
 }
 
-/// Helper function to cast from `Utf8` to `LargeUtf8` and vice versa. If the 
`LargeUtf8` is too large for
-/// a `Utf8` array it will return an Error.
-fn cast_str_container<OffsetSizeFrom, OffsetSizeTo>(
-    array: &dyn Array,
-) -> Result<ArrayRef, ArrowError>
+/// Helper function to cast from one `ByteArrayType` to another and vice versa.
+/// If the target one (e.g., `LargeUtf8`) is too large for the source array it 
will return an Error.
+fn cast_byte_container<FROM, TO>(array: &dyn Array) -> Result<ArrayRef, 
ArrowError>
 where
-    OffsetSizeFrom: OffsetSizeTrait + ToPrimitive,
-    OffsetSizeTo: OffsetSizeTrait + NumCast + ArrowNativeType,
+    FROM: ByteArrayType,
+    TO: ByteArrayType,
+    FROM::Offset: OffsetSizeTrait + ToPrimitive,
+    TO::Offset: OffsetSizeTrait + NumCast + ArrowNativeType,

Review Comment:
   ```suggestion
       TO::Offset: OffsetSizeTrait + NumCast,
   ```
   I think ArrowNativeType is implied by OffsetSizeTrait



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