alamb commented on code in PR #2289:
URL: https://github.com/apache/arrow-rs/pull/2289#discussion_r936502397
##########
arrow/src/array/array_binary.rs:
##########
@@ -37,15 +37,17 @@ pub struct GenericBinaryArray<OffsetSize: OffsetSizeTrait> {
}
impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize> {
+ /// Data type of the array.
+ pub const DATA_TYPE: DataType = if OffsetSize::IS_LARGE {
+ DataType::LargeBinary
+ } else {
+ DataType::Binary
+ };
+
/// Get the data type of the array.
- // Declare this function as `pub const fn` after
- // https://github.com/rust-lang/rust/issues/93706 is merged.
- pub fn get_data_type() -> DataType {
- if OffsetSize::IS_LARGE {
- DataType::LargeBinary
- } else {
- DataType::Binary
- }
+ #[deprecated(note = "please use `Self::DATA_TYPE` instead")]
Review Comment:
💯 for deprecation
--
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]