Skip to content

Commit e907bf8

Browse files
jayzhan211tustvold
andauthored
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]>
1 parent e1ac2bb commit e907bf8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

arrow-array/src/cast.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -778,34 +778,34 @@ pub trait AsArray: private::Sealed {
778778
self.as_bytes_opt().expect("binary array")
779779
}
780780

781-
/// Downcast this to a [`StringViewArray`] returning `None` if not possible
782-
fn as_string_view(&self) -> &StringViewArray {
783-
self.as_byte_view_opt().expect("string view array")
784-
}
785-
786781
/// Downcast this to a [`StringViewArray`] returning `None` if not possible
787782
fn as_string_view_opt(&self) -> Option<&StringViewArray> {
788783
self.as_byte_view_opt()
789784
}
790785

791-
/// Downcast this to a [`StringViewArray`] returning `None` if not possible
792-
fn as_binary_view(&self) -> &BinaryViewArray {
793-
self.as_byte_view_opt().expect("binary view array")
786+
/// Downcast this to a [`StringViewArray`] panicking if not possible
787+
fn as_string_view(&self) -> &StringViewArray {
788+
self.as_byte_view_opt().expect("string view array")
794789
}
795790

796791
/// Downcast this to a [`BinaryViewArray`] returning `None` if not possible
797792
fn as_binary_view_opt(&self) -> Option<&BinaryViewArray> {
798793
self.as_byte_view_opt()
799794
}
800795

801-
/// Downcast this to a [`GenericByteViewArray`] returning `None` if not possible
802-
fn as_byte_view<T: ByteViewType>(&self) -> &GenericByteViewArray<T> {
803-
self.as_byte_view_opt().expect("byte view array")
796+
/// Downcast this to a [`BinaryViewArray`] panicking if not possible
797+
fn as_binary_view(&self) -> &BinaryViewArray {
798+
self.as_byte_view_opt().expect("binary view array")
804799
}
805800

806801
/// Downcast this to a [`GenericByteViewArray`] returning `None` if not possible
807802
fn as_byte_view_opt<T: ByteViewType>(&self) -> Option<&GenericByteViewArray<T>>;
808803

804+
/// Downcast this to a [`GenericByteViewArray`] panicking if not possible
805+
fn as_byte_view<T: ByteViewType>(&self) -> &GenericByteViewArray<T> {
806+
self.as_byte_view_opt().expect("byte view array")
807+
}
808+
809809
/// Downcast this to a [`StructArray`] returning `None` if not possible
810810
fn as_struct_opt(&self) -> Option<&StructArray>;
811811

0 commit comments

Comments
 (0)