(iter: I)
| 1486 | /// I.e. that `size_hint().1` correctly reports its length. |
| 1487 | #[inline] |
| 1488 | pub unsafe fn from_trusted_len_iter<I, P>(iter: I) -> Self |
| 1489 | where |
| 1490 | P: std::borrow::Borrow<Option<<T as ArrowPrimitiveType>::Native>>, |
| 1491 | I: IntoIterator<Item = P>, |
| 1492 | { |
| 1493 | let iterator = iter.into_iter(); |
| 1494 | let (_, upper) = iterator.size_hint(); |
| 1495 | let len = upper.expect("trusted_len_unzip requires an upper limit"); |
| 1496 | |
| 1497 | let (null, buffer) = unsafe { trusted_len_unzip(iterator) }; |
| 1498 | |
| 1499 | let nulls = NullBuffer::from_unsliced_buffer(null, len); |
| 1500 | PrimitiveArray::new(ScalarBuffer::from(buffer), nulls) |
| 1501 | } |
| 1502 | } |
| 1503 | |
| 1504 | // TODO: the macro is needed here because we'd get "conflicting implementations" error |
nothing calls this directly
no test coverage detected