1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::array::default_arrays::FromData;
use crate::trusted_len::TrustedLen;
use crate::utils::FromTrustedLenIterator;
use arrow::array::BooleanArray;
use arrow::bitmap::MutableBitmap;
impl FromTrustedLenIterator<Option<bool>> for BooleanArray {
fn from_iter_trusted_length<I: IntoIterator<Item = Option<bool>>>(iter: I) -> Self
where
I::IntoIter: TrustedLen,
{
unsafe { BooleanArray::from_trusted_len_iter_unchecked(iter.into_iter()) }
}
}
impl FromTrustedLenIterator<bool> for BooleanArray {
fn from_iter_trusted_length<I: IntoIterator<Item = bool>>(iter: I) -> Self
where
I::IntoIter: TrustedLen,
{
unsafe {
BooleanArray::from_data_default(
MutableBitmap::from_trusted_len_iter_unchecked(iter.into_iter()).into(),
None,
)
}
}
}