Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update doc of array_binary and array_string #1491

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions arrow/src/array/array_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<OffsetSize: BinaryOffsetSizeTrait> GenericBinaryArray<OffsetSize> {
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<Ptr, I>(iter: I) -> Self
where
Ptr: AsRef<[u8]>,
Expand Down Expand Up @@ -213,7 +213,7 @@ impl<OffsetSize: BinaryOffsetSizeTrait> GenericBinaryArray<OffsetSize> {
/// 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<Item = Option<usize>> + 'a,
Expand Down Expand Up @@ -429,7 +429,7 @@ impl<T: BinaryOffsetSizeTrait> From<GenericListArray<T>> for GenericBinaryArray<
}
}

/// A type of `FixedSizeListArray` whose elements are binaries.
/// An array where each element is a fixed-size sequence of bytes.
///
/// # Examples
///
Expand Down Expand Up @@ -983,8 +983,8 @@ impl From<DecimalArray> 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,
Expand Down
10 changes: 5 additions & 5 deletions arrow/src/array/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ impl<OffsetSize: StringOffsetSizeTrait> GenericStringArray<OffsetSize> {
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<Ptr, I>(iter: I) -> Self
where
Ptr: AsRef<str>,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<OffsetSize: StringOffsetSizeTrait> GenericStringArray<OffsetSize> {
/// 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<Item = Option<usize>> + 'a,
Expand Down Expand Up @@ -212,7 +212,7 @@ impl<'a, Ptr, OffsetSize: StringOffsetSizeTrait> FromIterator<Option<Ptr>>
where
Ptr: AsRef<str>,
{
/// Creates a [`GenericStringArray`] based on an iterator of `Option`s
/// Creates a [`GenericStringArray`] based on an iterator of [`Option`]s
fn from_iter<I: IntoIterator<Item = Option<Ptr>>>(iter: I) -> Self {
let iter = iter.into_iter();
let (_, data_len) = iter.size_hint();
Expand Down