// take implementation when neither values nor indices contain nulls
take implementation when neither values nor indices contain nulls
take implementation when neither values nor indices contain nulls
fn take_no_nulls<T, I>(values: &[T], indices: &[I]) -> Result<(Buffer, Option<Buffer>)>
where
    T: ArrowNativeType,
    I: ArrowNativeType,
{
    let values = indices
        .iter()
        .map(|index| Result::Ok(values[maybe_usize::<I>(*index)?]));
    // Soundness: `slice.map` is `TrustedLen`.
    let buffer = unsafe { Buffer::try_from_trusted_len_iter(values)? };
    Ok((buffer, None))
}
fn take_no_nulls < T , I > ( values : & [ T ] , indices : & [ I ] ) -> Result < ( Buffer , Option < Buffer > ) > where T : ArrowNativeType , I : ArrowNativeType , { let values = indices . iter ( ) . map ( | index | Result :: Ok ( values [ maybe_usize :: < I > ( * index ) ? ] ) ) ; // Soundness: `slice.map` is `TrustedLen`. let buffer = unsafe { Buffer :: try_from_trusted_len_iter ( values ) ? } ; Ok ( ( buffer , None ) ) }
take implementation when neither values nor indices contain nulls
take implementation when neither values nor indices contain nulls
values
&[T]
indices
&[I]