From 75e9156c1bc7e5976f90f3bf2a33fc65f4f5470c Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:22:01 +0800 Subject: [PATCH] Improved the docs --- src/array/binary/mutable.rs | 4 ++-- src/compute/comparison/utf8.rs | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/array/binary/mutable.rs b/src/array/binary/mutable.rs index f353af63db3..ad79bd278e6 100644 --- a/src/array/binary/mutable.rs +++ b/src/array/binary/mutable.rs @@ -192,7 +192,7 @@ impl MutableBinaryArray { { let (validity, offsets, values) = trusted_len_unzip(iterator); - // soundness: P is `str` + // soundness: P is `AsRef<[u8]>` Self::from_data(Self::default_data_type(), offsets, values, validity) } @@ -235,7 +235,7 @@ impl MutableBinaryArray { // soundness: assumed trusted len let (validity, offsets, values) = try_trusted_len_unzip(iterator)?; - // soundness: P is `str` + // soundness: P is `AsRef<[u8]>` Ok(Self::from_data( Self::default_data_type(), offsets, diff --git a/src/compute/comparison/utf8.rs b/src/compute/comparison/utf8.rs index 17f365ec23f..7fd449e520a 100644 --- a/src/compute/comparison/utf8.rs +++ b/src/compute/comparison/utf8.rs @@ -22,7 +22,7 @@ use crate::{array::*, bitmap::Bitmap}; use super::{super::utils::combine_validities, Operator}; -/// Evaluate `op(lhs, rhs)` for [`PrimitiveArray`]s using a specified +/// Evaluate `op(lhs, rhs)` for [`Utf8Array`]s using a specified /// comparison function. fn compare_op(lhs: &Utf8Array, rhs: &Utf8Array, op: F) -> Result where @@ -46,7 +46,7 @@ where Ok(BooleanArray::from_data(DataType::Boolean, values, validity)) } -/// Evaluate `op(lhs, rhs)` for [`PrimitiveArray`] and scalar using +/// Evaluate `op(lhs, rhs)` for [`Utf8Array`] and scalar using /// a specified comparison function. fn compare_op_scalar(lhs: &Utf8Array, rhs: &str, op: F) -> BooleanArray where @@ -61,62 +61,62 @@ where BooleanArray::from_data(DataType::Boolean, values, validity) } -/// Perform `lhs == rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs == rhs` operation on [`Utf8Array`]. fn eq(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a == b) } -/// Perform `lhs == rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs == rhs` operation on [`Utf8Array`] and a scalar. fn eq_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a == b) } -/// Perform `lhs != rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs != rhs` operation on [`Utf8Array`]. fn neq(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a != b) } -/// Perform `lhs != rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs != rhs` operation on [`Utf8Array`] and a scalar. fn neq_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a != b) } -/// Perform `lhs < rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs < rhs` operation on [`Utf8Array`]. fn lt(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a < b) } -/// Perform `lhs < rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs < rhs` operation on [`Utf8Array`] and a scalar. fn lt_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a < b) } -/// Perform `lhs <= rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs <= rhs` operation on [`Utf8Array`]. fn lt_eq(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a <= b) } -/// Perform `lhs <= rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs <= rhs` operation on [`Utf8Array`] and a scalar. fn lt_eq_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a <= b) } -/// Perform `lhs > rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs > rhs` operation on [`Utf8Array`]. fn gt(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a > b) } -/// Perform `lhs > rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs > rhs` operation on [`Utf8Array`] and a scalar. fn gt_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a > b) } -/// Perform `lhs >= rhs` operation on [`StringArray`] / [`LargeStringArray`]. +/// Perform `lhs >= rhs` operation on [`Utf8Array`]. fn gt_eq(lhs: &Utf8Array, rhs: &Utf8Array) -> Result { compare_op(lhs, rhs, |a, b| a >= b) } -/// Perform `lhs >= rhs` operation on [`StringArray`] / [`LargeStringArray`] and a scalar. +/// Perform `lhs >= rhs` operation on [`Utf8Array`] and a scalar. fn gt_eq_scalar(lhs: &Utf8Array, rhs: &str) -> BooleanArray { compare_op_scalar(lhs, rhs, |a, b| a >= b) }