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


##########
arrow/src/array/array_binary.rs:
##########
@@ -35,29 +35,23 @@ use crate::error::{ArrowError, Result};
 use crate::util::bit_util;
 use crate::{buffer::MutableBuffer, datatypes::DataType};
 
-/// Like [`OffsetSizeTrait`], but specialized for Binary.
-/// This allow us to expose a constant datatype for the [`GenericBinaryArray`].
-pub trait BinaryOffsetSizeTrait: OffsetSizeTrait {
-    const DATA_TYPE: DataType;
-}
-
-impl BinaryOffsetSizeTrait for i32 {
-    const DATA_TYPE: DataType = DataType::Binary;
-}
-
-impl BinaryOffsetSizeTrait for i64 {
-    const DATA_TYPE: DataType = DataType::LargeBinary;
-}
-
 /// See [`BinaryArray`] and [`LargeBinaryArray`] for storing
 /// binary data.
-pub struct GenericBinaryArray<OffsetSize: BinaryOffsetSizeTrait> {
+pub struct GenericBinaryArray<OffsetSize: OffsetSizeTrait> {
     data: ArrayData,
     value_offsets: RawPtrBox<OffsetSize>,
     value_data: RawPtrBox<u8>,
 }
 
-impl<OffsetSize: BinaryOffsetSizeTrait> GenericBinaryArray<OffsetSize> {
+impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize> {
+    pub fn get_data_type() -> DataType {

Review Comment:
   Edit: just saw your comment



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