Skip to content

Commit

Permalink
Minor: fix misleading comment in byte view (apache#6695)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jayzhan211 and tustvold authored Nov 6, 2024
1 parent e1ac2bb commit e907bf8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions arrow-array/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,34 +778,34 @@ 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
fn as_binary_view_opt(&self) -> Option<&BinaryViewArray> {
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>;

Expand Down

0 comments on commit e907bf8

Please sign in to comment.