MCPcopy Create free account
hub / github.com/apache/arrow-rs / from_trusted_len_iter_bool

Method from_trusted_len_iter_bool

arrow-buffer/src/buffer/mutable.rs:1008–1013  ·  view source on GitHub ↗
(mut iterator: I)

Source from the content-addressed store, hash-verified

1006 // 2. `from_trusted_len_iter_bool` is faster.
1007 #[inline]
1008 pub unsafe fn from_trusted_len_iter_bool<I: Iterator<Item = bool>>(mut iterator: I) -> Self {
1009 let (_, upper) = iterator.size_hint();
1010 let len = upper.expect("from_trusted_len_iter requires an upper limit");
1011
1012 Self::collect_bool(len, |_| iterator.next().unwrap())
1013 }
1014
1015 /// Creates a [`MutableBuffer`] from an [`Iterator`] with a trusted (upper) length or errors
1016 /// if any of the items of the iterator is an error.

Callers

nothing calls this directly

Calls 3

collect_boolFunction · 0.85
size_hintMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected