diff --git a/arrow/src/array/array_binary.rs b/arrow/src/array/array_binary.rs index a5decc21bc5f..56b572ce2aa6 100644 --- a/arrow/src/array/array_binary.rs +++ b/arrow/src/array/array_binary.rs @@ -34,8 +34,8 @@ 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 +/// 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; } @@ -166,7 +166,7 @@ impl GenericBinaryArray { Self::from(data) } - /// Creates a `GenericBinaryArray` based on an iterator of values without nulls + /// Creates a [`GenericBinaryArray`] based on an iterator of values without nulls pub fn from_iter_values(iter: I) -> Self where Ptr: AsRef<[u8]>, @@ -213,7 +213,7 @@ impl GenericBinaryArray { /// Returns an iterator that returns the values of `array.value(i)` for an iterator with each element `i` /// # Safety /// - /// caller must ensure that the offsets in the iterator are less than the array len() + /// caller must ensure that the indexes in the iterator are less than the `array.len()` pub unsafe fn take_iter_unchecked<'a>( &'a self, indexes: impl Iterator> + 'a, @@ -429,7 +429,7 @@ impl From> for GenericBinaryArray< } } -/// A type of `FixedSizeListArray` whose elements are binaries. +/// An array where each element is a fixed-size sequence of bytes. /// /// # Examples /// @@ -983,8 +983,8 @@ impl From for ArrayData { } } -/// an iterator that returns Some(i128) or None, that can be used on a -/// DecimalArray +/// an iterator that returns `Some(i128)` or `None`, that can be used on a +/// [`DecimalArray`] #[derive(Debug)] pub struct DecimalIter<'a> { array: &'a DecimalArray, diff --git a/arrow/src/array/array_string.rs b/arrow/src/array/array_string.rs index b17534ac53f7..a64bd750791f 100644 --- a/arrow/src/array/array_string.rs +++ b/arrow/src/array/array_string.rs @@ -27,8 +27,8 @@ use crate::buffer::Buffer; use crate::util::bit_util; use crate::{buffer::MutableBuffer, datatypes::DataType}; -/// Like OffsetSizeTrait, but specialized for Strings -// This allow us to expose a constant datatype for the GenericStringArray +/// Like [`OffsetSizeTrait`], but specialized for Strings. +/// This allow us to expose a constant datatype for the [`GenericStringArray`]. pub trait StringOffsetSizeTrait: OffsetSizeTrait { const DATA_TYPE: DataType; } @@ -137,7 +137,7 @@ impl GenericStringArray { Self::from(array_data) } - /// Creates a `GenericStringArray` based on an iterator of values without nulls + /// Creates a [`GenericStringArray`] based on an iterator of values without nulls pub fn from_iter_values(iter: I) -> Self where Ptr: AsRef, @@ -184,7 +184,7 @@ impl GenericStringArray { /// Returns an iterator that returns the values of `array.value(i)` for an iterator with each element `i` /// # Safety /// - /// caller must ensure that the offsets in the iterator are less than the array len() + /// caller must ensure that the indexes in the iterator are less than the `array.len()` pub unsafe fn take_iter_unchecked<'a>( &'a self, indexes: impl Iterator> + 'a, @@ -212,7 +212,7 @@ impl<'a, Ptr, OffsetSize: StringOffsetSizeTrait> FromIterator> where Ptr: AsRef, { - /// Creates a [`GenericStringArray`] based on an iterator of `Option`s + /// Creates a [`GenericStringArray`] based on an iterator of [`Option`]s fn from_iter>>(iter: I) -> Self { let iter = iter.into_iter(); let (_, data_len) = iter.size_hint();