This is an automated email from the ASF dual-hosted git repository.
jayzhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new e907bf8e3 Minor: fix misleading comment in byte view (#6695)
e907bf8e3 is described below
commit e907bf8e3df5cd8cba8b5f761f9291f2ec0c2730
Author: Jay Zhan <[email protected]>
AuthorDate: Wed Nov 6 19:50:08 2024 +0800
Minor: fix misleading comment in byte view (#6695)
* fix comment
Signed-off-by: jayzhan211 <[email protected]>
* Update arrow-array/src/cast.rs
Co-authored-by: Raphael Taylor-Davies
<[email protected]>
---------
Signed-off-by: jayzhan211 <[email protected]>
Co-authored-by: Raphael Taylor-Davies
<[email protected]>
---
arrow-array/src/cast.rs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/arrow-array/src/cast.rs b/arrow-array/src/cast.rs
index 8c7cc2a12..501e85ced 100644
--- a/arrow-array/src/cast.rs
+++ b/arrow-array/src/cast.rs
@@ -778,19 +778,14 @@ pub trait AsArray: private::Sealed {
self.as_bytes_opt().expect("binary array")
}
- /// Downcast this to a [`StringViewArray`] returning `None` if not possible
- fn as_string_view(&self) -> &StringViewArray {
- self.as_byte_view_opt().expect("string view array")
- }
-
/// Downcast this to a [`StringViewArray`] returning `None` if not possible
fn as_string_view_opt(&self) -> Option<&StringViewArray> {
self.as_byte_view_opt()
}
- /// Downcast this to a [`StringViewArray`] returning `None` if not possible
- fn as_binary_view(&self) -> &BinaryViewArray {
- self.as_byte_view_opt().expect("binary view array")
+ /// Downcast this to a [`StringViewArray`] panicking if not possible
+ fn as_string_view(&self) -> &StringViewArray {
+ self.as_byte_view_opt().expect("string view array")
}
/// Downcast this to a [`BinaryViewArray`] returning `None` if not possible
@@ -798,14 +793,19 @@ pub trait AsArray: private::Sealed {
self.as_byte_view_opt()
}
- /// Downcast this to a [`GenericByteViewArray`] returning `None` if not
possible
- fn as_byte_view<T: ByteViewType>(&self) -> &GenericByteViewArray<T> {
- self.as_byte_view_opt().expect("byte view array")
+ /// Downcast this to a [`BinaryViewArray`] panicking if not possible
+ fn as_binary_view(&self) -> &BinaryViewArray {
+ self.as_byte_view_opt().expect("binary view array")
}
/// Downcast this to a [`GenericByteViewArray`] returning `None` if not
possible
fn as_byte_view_opt<T: ByteViewType>(&self) ->
Option<&GenericByteViewArray<T>>;
+ /// Downcast this to a [`GenericByteViewArray`] panicking if not possible
+ fn as_byte_view<T: ByteViewType>(&self) -> &GenericByteViewArray<T> {
+ self.as_byte_view_opt().expect("byte view array")
+ }
+
/// Downcast this to a [`StructArray`] returning `None` if not possible
fn as_struct_opt(&self) -> Option<&StructArray>;