Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 committed Mar 27, 2022
1 parent 6bf3b3a commit 7da5769
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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

0 comments on commit 7da5769

Please sign in to comment.